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

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




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


An extra empty line is generated between two lines.

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

[2]: KK Street
[4]: Karnataka


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


This worked. Thanks