c# - How to overwrite a string with another string? -


how can overwrite string ? example:

string text = "abcdefghijklmnopqrstuvwxyz".overwritewith("hello world", 3); // text == "abchello worldopqrstuvwxyz" 

of course method doesn't exist. but

  • is there build in in .net framework ?
  • if not, how can efficiently write string string ?

short answer, cannot. strings immutable type. means once created, cannot modified.

if want manipulated strings in memory, c++ way, should use stringbuilder.


Comments

Popular posts from this blog

java - How to Configure JAXRS and Spring With Annotations -

visual studio - TFS will not accept changes I've made to a Java project -

php - Create image in codeigniter on the fly -