How to remove only US test in string "US USA"

how to remove US text from String as below


answer need only USA

Hi @Ram_Gurav1

Try the expression below!

Split(YourStringVar," ")(1)

will give the result USA


some time not available “US”

that’s why we need to replace option

Hi @Ram_Gurav1

Please try this,

strText - your variable name

string.join(" ",strText.split(" "c).select(function(d) not d.tostring.trim.toupper.equals("US")).toarray)



As any alternative you can use IF condition as

“US USA”.Equal(“USA”)

Then-> False
Else → use your logic

Hope this will help you


thanks to all for helping me
i have used below function its work


This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.