I have a text “Casid (Our Id) : 23142341574-05 (Status)” and I’m using strLoanStatus.Substring(strLoanStatus.IndexOf(“(”) + 1) to try and retrieve the value (Status) within the string but it always returns “Our Id) : 23142341574-05 (Status)” what would be the fix for this.
If your input string is of single line:- requiredStr = System.Text.RegularExpressions.Regex.Match("Your Input String","(?<=\()[A-z]+(?=\))").Value
If your input string is of multi-line:- requiredStr = System.Text.RegularExpressions.Regex.Match("Your Input String","(?<=\()[A-z]+(?=\))", System.Text.RegularExpressions.RegexOptions.Multiline).Value
To retrieve the value of “Status” from the text “Casid (Our Id) : 23142341574-05 (Status)” using UiPath, you can modify your substring method to include an additional argument for the length of the substring you want to extract.
Here’s an example of how you can extract the “Status” value from the given text using Substring method in UiPath:
Assign the given text to a variable, for example, strLoanStatus.
Use the Substring method to extract the “Status” value from the text. Instead of using strLoanStatus.Substring(strLoanStatus.IndexOf("(") + 1), use the following code to extract the “Status” value: