Notifications
Announcements
No record found.
Hi.
so let's say i have the following strings
str firstString = "123-345"
str secondString = xx-w
i want to detect the dash then remove the dash and everything after the dash
so the output should be like this
firstString = "123"
secondString = "xx"
Hi junior AX,
You can use string functions - strFind and SubStr. You can check here for more examples.
str firstString = '123-345; int pos; str newString; pos = strFind(firstString, "-", 1, strLen(firstString)); newString = subStr(firstString, 1, pos-1);
You could also use strDel method.
Str example = 'ABC-111'; info(strDel(example, strFind(example, "-", 1, strLen(example)), strLen(example)-strFind(example, "-", 1, strLen(example)) 1));
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
As AI tools become more common, we’re introducing a Responsible AI Use…
We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…
These are the community rock stars!
Stay up to date on forum activity by subscribing.
Martin Dráb 660 Most Valuable Professional
André Arnaud de Cal... 549 Super User 2025 Season 2
Sohaib Cheema 307 User Group Leader