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

Detect support for Shoutcast ICY MP3 without navigator.userAgent in Firefox? -

web - SVG not rendering properly in Firefox -

java - JavaFX 2 slider labelFormatter not being used -