bawaarao
(Bruno)
1
Hello,
I want to replace the blank spaces in my string (" ") if the characters between the space arent numbers.
For example: If the input string is “10/20/2020 Name and City 1234 4321” the output string should be like: “10/20/2020 Name_and_City 1234 4321”.
PS: The non-number part of the string is not always the same.
Can anyone help?
Yoichi
(Yoichi)
2
Hi,
Hope the following expression helps you.
System.Text.RegularExpressions.Regex.Replace(strData,"(?<=[A-Za-z]) (?=[A-Za-z])","_")
or
System.Text.RegularExpressions.Regex.Replace(strData,"(?<=\D) (?=\D)","_")
Regards,
bawaarao
(Bruno)
4
system
(system)
Closed
5
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.