HELP
I need a RegEx For Extracting Middle Intial From String
Ex. John H Moriarty (Format is Fixed)
o/p should be = H
HELP
I need a RegEx For Extracting Middle Intial From String
Ex. John H Moriarty (Format is Fixed)
o/p should be = H
Hi
Welcome to UiPath forum
Use a assign activity like this
I assume u have saved the input string in variable named Strinput
stroutput = System.Text.RegularExpressions.Regex.Match(Strinput.ToString, “\b\w\b”).Value.ToString
Hope this helps
Cheers @Ankit2
Assign: Expression Activity type ‘VisualBasicValue`1’ requires compilation in order to run. Please ensure that the workflow has been compiled
This Error is coming
Hi @Ankit2
Use this Regex expression
Input= " John H Moriarty"
Output= System.Text.RegularExpressions.Regex.Match(Input,"\b[A-Z]\b").Value
Or
Input= " John H Moriarty"
Output= Input.Split(" ")(1)
Hope it helps!!
1st Solution Worked
Thanku so much
If you find the solution for your query please mark it as solution to close the loop.
Happy Automation
Regards
yes thanku for helping out
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.