I have a string Company Name, 123 Fake street,Farnham House,Cork,Ireland. The part of the string which has company name could be any name. I want to be able to remove this and only return 123 Fake street,Farnham House,Cork,Ireland. How can this be done
Input_str.Replace(Input_str.Split(“,”).First.ToString.Trim,“”).Replace(“,”,“”).trim
Hope It Helps!!!
1 Like
- Assign originalString = “Company Name, 123 Fake street,Farnham House,Cork,Ireland”
- Assign companyNamePattern = “(.*?),”
- Assign modifiedString = System.Text.RegularExpressions.Regex.Replace(originalString, companyNamePattern, “”)
- Log Message: Output modifiedString
Hi @duaine.b
You can use the regular expressions for that.
- Assign -> Input = "Company Name, 123 Fake street,Farnham House,Cork,Ireland"
- Assign -> Output = System.Text.RegularExpressions.Regex.Match(Input.ToString,"((?<=\,\s+).*)").Value
Check the below workflow for better understanding.
Hope it helps!!
you can try with this
str_variable =System.Text.RegularExpressions.Regex.Match(“yourText”,“(?![Company Name,]).*”).Value.Trim
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.