Input string: “Amount $124.238”
After splitup!
Input array =
“Amount”
" "
" "
" "
“$124.238”
Index value is not fixed. Spaces may increase/decrease.
Question: How do I fetch value “$124.238” from the whole array
Input string: “Amount $124.238”
After splitup!
Input array =
“Amount”
" "
" "
" "
“$124.238”
Index value is not fixed. Spaces may increase/decrease.
Question: How do I fetch value “$124.238” from the whole array
strinput.split({"Amount"},StringSplitOptions.RemoveEmptyEntries).Last.trim
You can try this
You can use the substring to get the desired results
str_Input.Substring(str_Input.IndexOf("$")).Trim
Hope this helps ![]()
Input variable is of type " Ienumerable" from regex activity “Matches”.
It gives me Null value as output
Input variable is of type " Ienumerable" from regex activity “Matches”.
It gives me Null output
Try this:
Input = "Amount $124.238"
Output = System.Text.RegularExpressions.Regex.Match(Input,"\$\d+[.,]\d+").Value.Trim()
Input = "Amount $124.238"
Output = Input.Split({" "c}, StringSplitOptions.RemoveEmptyEntries).FirstOrDefault(Function(x) x.StartsWith("$"))
Let me if you have any queries, I’m happy to help.
Regards
I think this is another question where you are using matches in the regex expression can you share the snip of your code where you are getting this error. If you use the code given by me or nikhil this error will not come
stroutput.Cast(of match).select(Function(a) a.ToString).where(Function(a) not string.IsNullOrEmpty(a.tostring)).last
you can use this and pass the output of matches variable in place of stroutput
Using this.
What if I have multiple name for key,
I.e " Amount" or Total Amount"
use this expression
system.Text.RegularExpressions.Regex.Match(strinput,"[$\d.]+").tostring.trim
Thank you so much. Working Fine
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.