How to split a variable value with respect to each each line?

I have to separate out each line of address to different indexes of an array.

Eg: 123/68A
KK Street
Karnataka

This address should be split with respect to each line and save to an array.

3 Likes

@certified

Try this into an ‘Assign’: arrayVar = yourText.Split(Environment.NewLine.ToArray)

2 Likes

An extra empty line is generated between two lines.

Below is the array created. Why is this getting created like this.

[1]:
[2]: KK Street
[3]:
[4]: Karnataka

1 Like

Try: yourText.Split(Environment.NewLine.ToArray, StringSplitOptions.RemoveEmptyEntries). Hope it works!

11 Likes

This worked. Thanks

1 Like