How to replace multiple strings in a given string in single line

Some times we need to replace more than one string or character from a string(text) 

In that condition we can use two ways.

First is to replace one by one which takes more line of code...and another is in a single line..

I am showing here second way..

string str="x/o/f";

str = str.Replace("x", "Xray").Replace("o", "option").Replace("f", "folder");

it will gives the result as follows

str="Xray/option/folder";
Ebook Download
View all
Learn
View all