i have a string
i need to write this string as
how can i do
as i dont want comma between spirit lake
var regex = new Regex(Regex.Escape(",")); var newText = regex.Replace("SPIRIT,LAKE,IA,51360", " ", 1);
ReplaceFirstOccurenceOfComma.xaml (5.8 KB)
Try this. No regex has been used.
You can go with @PrankurJoshi one.
but you want simple and short you can go with this:-
String Str = SPIRIT,LAKE,IA,51360 String Final_Str = Str.Remove(Str.IndexOf(","c),1).Insert(Str.IndexOf(","c)," ") // Output:- SPIRIT LAKE,IA,51360
“PRINCETON, NJ 08540-6819”
this is string
so i will get problem in such if i handle that
spirit late is city name with 2 words
there are city with one name too