How to split string avoid from null value

When I use stringValue.Split(Environment.NewLine.ToArray,StringSplitOptions.None) , it return also null value . How to avoid it? Please Suggest me , Thanks!

@Soe_Min_Latt

Try this:

stringValue.Split(Environment.NewLine.ToCharArray,StringSplitOptions.None)

1 Like

Hi @Soe_Min_Latt

Use strvar=strval.split(“”,c)

Thanks
Ashwin.S

1 Like

Hi @lakshman,
It is also return null…

1 Like

@Soe_Min_Latt

Could you please show me screenshot of your input String. So that we can help you better.

Hi @AshwinS2,
I want to split line by line
Thanks,
Soe Min Latt

Hi @Soe_Min_Latt

Use environment.newline along with c

Thanks
Ashwin.S

1 Like

@Soe_Min_Latt

Try this:

stringValue.Split(Environment.NewLine.ToCharArray)

It will split our input String based on new line as delimiter and will give output as array of strings.

2 Likes

@lakshman I got it , Thanks!

1 Like

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