forum

Home / DeveloperSection / Forums / Replace characters in between string

Replace characters in between string

marcel ethan 1775 29-Mar-2014

I have the following string:

string input = "  2  1";

It is 2 spaces followed by a 2 and then 2 more spaces followed by a 1. I want to do a replace on it, but I only want to replace the spaces between the 2 and the 1 with 0's and I do not want to use RegEx if possible?

The end result should look like this:

string result = "  2001";


c# c# 
Updated on 29-Mar-2014

Can you answer this question?


Answer

1 Answers

Liked By