There will be no change in the structure. The only thing that will change it date and numbers so for example number might be 200 instead of 300,000.00 mentioned in above example. Both ending and beginning starting are static. Only extracted part will change.
Static part
[k(pgup)k(pgup)k(pgup)k(pgup)]
Changing part
05/02/2019 Updated Credit limit from 300,000.00 to 300000 via credit scoring model
1.Assign activity:
inputString = “[k(pgup)k(pgup)k(pgup)k(pgup)]05/02/2019 Updated Credit limit from 300,000.00 to 300000 via credit scoring model[k(enter)k(enter)]”
2.Assign activity
inputString = inputString.Substring(“[k(pgup)k(pgup)k(pgup)k(pgup)]”.Length)
3.Assign activity
inputString = inputString.Substring(0,inputstring.Length-“[k(enter)k(enter)]”.Length)
4. At end of this below screenshot I gave xaml file. Enjoy and happy automation!
Below is the flow where you can see the string that is needed to you. It can be done with regex also if needed. “05/02/2019 Updated Credit limit from 300,000.00 to 300000 via credit scoring model”
Find use these it works fine
Asign value as string = “[k(pgup)k(pgup)k(pgup)k(pgup)]05/02/2019 Updated Credit limit from 300,000.00 to 300000 via credit scoring model[k(enter)k(enter)]”
in write line use as below regex
System.Text.RegularExpressions.Regex.Replace(Value,“[(.*?)]”,“”).ToString
I did not give solution based on regex however I mentioned about it because it is sometimes difficult to understand and debug. Even if the developer looks his own code, he has to put a lot of effort in understanding.
where as in substring, it is straight forward and readable.
Hi @viswanarahari
agreed.
learning new ways is always helpful, but i go with two approaches as per requirement.
in your case inputString = inputString.Substring(“[k(pgup)k(pgup)k(pgup)k(pgup)]”.Length)
has changed to inputString = inputString.Substring([k(pgup)k(pgup)k(pgup)k(pgup)k(pgup)]".Length) then it might through error