NottyHead:
I am trying to work on an issue where if a String has multiple "special characters " in a string how do I replace that with a single Character. For Example: -
$a = "INC0010347~INC0010348~~INC0010349"
$a = $a.Replace("~~","~")
$a
Result 1: - "INC0010347~INC0010348~INC0010349"
Related Articles
In the above case a Replace function would work if the characters are 2 in number. However anything more than 2 will fail.. as in the below:
$a = "INC0010347~INC0010348~~~INC0010349"
$a = $a.Replace("~~","~")
$a
Result 2: - "INC0010347~INC0010348~~INC0010349"
I am working on a script that would help me do this dynamically irrespective of the number of special characters (in this case tilde(~)) the result should be
Result 1: - "INC0010347~INC0010348~INC0010349"
Posted in S.E.F
via StackOverflow & StackExchange Atomic Web Robots
This Question have been answered
HERE