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

Using 'OR' and 'AND' in SQL Server -

python - Finding intersection between ellipse and a line -

c++ - NetBeans Remote Development with additional configuration -