String to Array Query

Hii,

How t convert this string into Array
TCS_UID_Support_Request
Tracker:Production Problem
Subject:-ALERT-ColumnD
Description: Mail Body
Status:New
Priority: Critical
Assignee:TCS_UID
Files: (Alert Email)
Create and Continue

Thanks and Regards,
Supriya

@supu123

First assign entire text to one String variable and then try below expression.

 arrStr = String.Join(",",varStr.Split(Environment.NewLine.TocharArray)

Another way -

arrString = yourString.Split(Environment.NewLine)

Regards,
Karthik Byggari

Hi @supu123,

You mean, array of lines no, then try following

ArrVar = str1.Split(Environment.NewLine.ToCharArray)

where, ArrVar —> Array of String & str1 is your string variable

Hi everyone,
How to convert this string to json format

Thanks and Regards,
Supriya

@supu123,

firstly you’ve to import —> Newtonsoft.Json <— Namespace in your sequence.
And then use,

jsonStr (String) = JsonConvert.SerializeObject(ArrStr)

where ArrStr —> Array of string obtained by using split method mentioned in previous post.

OR

Try directly this

jsonStr (String) = JsonConvert.SerializeObject(strVar.Split(Environment.NewLine.TocharArray))

Hii @samir

The output of

[“TCS_MASTER_Support_Request”,“tracker:Production Problem”,“Subject:-ALERT-ColumnD”,“Description: Mail Body”,“Status:New”,“Priority: Critical”,“Assignee:TCS_masters”,“Files: (Alert Email)”,“Create and Continue”]

But after this if I am using deserialize json activity I m not getting the value of status field

How to solve this

Thanks and Regards,
Supriya