How to extract first line from string

Hello Guys,
Following is my string :
GSTIN : 27AAC CA803 3E1ZZ
AT T COMMUNICATION SERVICES INDIA PVT. LTD.
MAHARASHTRA

:: Dispatch From ::
4th Floor Platina C - 59
G Block Bandra-Kurla Complex, Bandra East,
Mumbai,MAHARASHTRA-400051

wanted to extract only first line(bold line)

1 Like

use split function condition as vbNewLine.

Your String.Split(Environment.NewLine.ToCharArray());

not working

Try this will work

–in assign activity take one variable of type array of strings and then use this syntax city.Split(Environment.NewLine.ToCharArray).ToArray()

First of all, please see your string pattern, whether it is really line by line or not. If it is not Line by line, this Environment.NewLine will not work.

@smita.mobifly

Try this:

Assign whole value to one String variable and say ‘Str’.

Str.Substring(Str.IndexOf("GSTIN : ")+“GSTIN :”.Length).split(Environment.Newline.TocharArray)(0)

3 Likes

yeppyyy :slight_smile:

Its working

Thank you so much

1 Like

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