If you want to do it in place:
abc = abc.Replace(" ", "_");
Although do realize a new string instance will be created; it’s not actually done in the same memory location – String is an immutable type.
If you want to do it in place:
abc = abc.Replace(" ", "_");
Although do realize a new string instance will be created; it’s not actually done in the same memory location – String is an immutable type.