Go to new line after each dot

Hey! How can I go to a new line after each dot in a string.

Example: str=“xxx.xxxx.xxxxx.xxx”
And the result I want is:
xxx.
xxxx.
xxxxx.
xxx

Howdy @jadbenn,

You would want to use an assign activity and then split your string wherever there is a period. Please take a look at the below screenshot and let me know if it helps:

Hey @Mr_Meeseeks,

Is it possible to have it in one string variable instead of looping through lines?

You can use the regex split if you need to keep the dots:
varArray = Regex.Split(str,"(?<=\.)")

@jadbenn

Sure why not :slight_smile:

myString.replace(".", “.” + environment.NewLine)

1 Like

:grin: i just understood that he wanted it all in one string

1 Like

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