String Manipulation and removal

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

@duaine.b

Input_str.Replace(Input_str.Split(“,”).First.ToString.Trim,“”).Replace(“,”,“”).trim

image

Hope It Helps!!!

1 Like

@duaine.b

  1. Assign originalString = “Company Name, 123 Fake street,Farnham House,Cork,Ireland”
  2. Assign companyNamePattern = “(.*?),”
  3. Assign modifiedString = System.Text.RegularExpressions.Regex.Replace(originalString, companyNamePattern, “”)
  4. Log Message: Output modifiedString

Hi @duaine.b

It Helps!

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

@duaine.b

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