C# Corner
Tech
News
Videos
Forums
Trainings
Books
Events
More
Interviews
Jobs
Live
Learn
Career
Members
Blogs
Challenges
Certifications
Bounties
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
How to Replace String in C#
WhatsApp
Pintoo Yadav
Dec 19
2014
1.8
k
0
1
string
str1 =
"ppp"
;
string
str2 =
"ccc"
;
string
str3 =
"kkk"
;
string
strAll3 = str1 +
", "
+str2+
", "
+str3 ;
string
[] strArray = strAll3.Split(
','
);
foreach
(
string
itm
in
strArray)
{
Console.WriteLine(itm.ToString() );
}
======
public
string
rep(
string
data) { data.Replace(
'\','
\\');
return
data; }
===
data = data.Replace(
"\\", "
\\\\");
C#
String
String in C#
Up Next
How to Replace String in C#