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
Post a Comment