Problem

4 /4


Replacing substrings in a string

Theory Click to read/hide

To replace one substring with another in a string in C#, use the method Replace(). There are two use cases:
Replace(char old, char new) -  char old replaced with char new;
Replace(string old, string new) -  string old is replaced by string new, i.e. more than one character can be replaced.

Inline replacement example in C#:

string phone = "+1-234-567-89-10";
// hyphens are changed to spaces
string edited_phone = phone.Replace("-", "  ");
// +1 234 567 89 10

Problem

A string is given. Replace all numbers in this line 1 with the word one
Input: a string is entered.
Output: print the answer to the problem (string).

Example.
Input Imprint
1+1=2 one+one=2