Hello.
I have a string like
Pocetni string. Follow up Q4 2024: Implementacija lokalnih firewall-ova jos nije sprovedena Implementacija lokalnih firewall-ova
How can I get substring before first occurance of Follow up Q4 2024?
Hello.
I have a string like
Pocetni string. Follow up Q4 2024: Implementacija lokalnih firewall-ova jos nije sprovedena Implementacija lokalnih firewall-ova
How can I get substring before first occurance of Follow up Q4 2024?
To extract the substring before the first occurrence of Follow up Q4 2024 in UiPath, you can use the Substring and IndexOf methods in an Assign activity. Here’s how you can do it:
Store the String:
String variable (e.g., inputString) to store your full string:Pocetni string. Follow up Q4 2024: Implementacija lokalnih firewall-ova jos nije sprovedena Implementacija lokalnih firewall-ova
Find the Index of the Keyword:
inputString.IndexOf("Follow up Q4 2024") to find the position of the first occurrence of Follow up Q4 2024.Extract the Substring:
inputString.Substring(0, inputString.IndexOf("Follow up Q4 2024")) to get the part of the string before the keyword.Variables:
inputString (String): Contains the full string.resultString (String): To store the extracted substring.Assign Activities:
inputString = "Pocetni string. Follow up Q4 2024: Implementacija lokalnih firewall-ova jos nije sprovedena Implementacija lokalnih firewall-ova"resultString = inputString.Substring(0, inputString.IndexOf("Follow up Q4 2024"))resultString will contain:
Pocetni string.
Let me know if you need further assistance!
.*(?=Follow up)
Assign Activity:
strSubString = System.Text.RegularExpressions(yourStringVar, ".*(?=Follow up)").Value
[CheatSheet] - System.Text.RegularExpressions | RegEx - News / Tutorials - UiPath Community Forum
Great, thank you for your help ![]()
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.