hi Team,
I/P : A#B#c###D####
Expected O/P : A,B,C,D
i tried something like this but getting error.
any suggestions or any Regex we can use for the same.
hi Team,
I/P : A#B#c###D####
Expected O/P : A,B,C,D
i tried something like this but getting error.
any suggestions or any Regex we can use for the same.
Try this
string.Join(",",inputstr.Split("#"c).Where(Function(a) not string.IsNullOrEmpty(a.ToString)).ToArray)
Change the both expressions as below,
- Assign -> outRes = InputVal.Replace("#"," ")
and
String.Join(",", outRes.Split(" "))
Hope it helps!!
Hi @devasaiprasad_K ,
Could also check with Regex Replace :
System.Text.RegularExpressions.Regex.Replace("A#B#C###D####","#{1,}",",").Trim(",".ToCharArray)
Try this
String.Join(", ", System.Text.RegularExpressions.Regex.Matches(Input,"\w+"))
Cheers!!
what exactly #{1,} does
Plese try with this
String.Join(β,β, inputString.Where(Function(c) Char.IsLetterOrDigit(c)).Select(Function(c) Char.ToUpper(c)))
Hi Devasaiprasad K,
Try this : System.Text.RegularExpressions.Regex.Replace(Input, β#+β, β,β).Trim
what exactly #{1,} does
Could try the below one,
- Assign -> Input = "A#B#C###D####"
- Assign -> Output = String.Join(",", Input.toString.Split("#"c).Where(Function(x) Not String.IsNullOrEmpty(x)).ToArray())
Check the below workflow for better understanding,
Hope it helps!!
Apologies for the late reply.
#{1,}
is basically a regex expression, which matches one or more occurrences of the character #.
We could check the expression meaning in bit more expressed terms with some regex websites like below :
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.