i am using get text to get ABCD1234 and im storing in variable like gettextvar and i want to add a single number at the end like ABCD1235 so may i know how to do this please?
How to add a number that contains string and numbers. for example ABCD1234 and i want to add +1 to end like ABCD1235
You can try the following steps:
- Use the Match activity to check with regular expression and fetch the number value from your string as below:
Regex - [0-9]\d*(.[0-9]\d+)?
This will return the matched numbers from your string as IEnumerable type.
From the output you can take the first match which will be 1234
In the Assign activity you can convert this to Integer and can add 1 to it.
could you ellobrate for like… by getting text var from get get text activity then passing it to regex… sorry i dont how to do this so could you please share xaml for this please…that would be really helpful. and thanks for the reply rajeshwari
Please try out this xaml
NumberFetchFromString.xaml (6.6 KB)
The string which is returned by Get Text activity have to be given as input to Matches activity
hi rajeshwari huge thanks for this effort… one last thing to ask… when i ran your xaml im getting values just only for numbers like 1235 for 1234 number but i want abcd1235 as string and number to be concatinated at end…sorry for asking too much im new to this…
Check this new xaml which will do the needful.
NumberFetchFromString_Revised.xaml (9.5 KB)
FYI, the following expression will return what you expect (even if the number string starts with 0)
thank you so much…it means lot to me… really very huge thanks rajeshwari…u saved me
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.