String manipulation - Split function

Hi,
I have string like below,
Stringvalue = { “text1” : John, “text2” : Lewis, “text3” : Jimmy}

But I need the result like this,
Stringvalue =
{
“text1” : John,
“text2” : Lewis,
“text3” : Jimmy
}

Hi @besakkiappan46

StringValue = StringValue.Replace(", ", "," + Environment.NewLine + "  ")
StringValue = "{" + Environment.NewLine + "  " + StringValue + Environment.NewLine + "}"

Hope it helps!!

@besakkiappan46

Main
├─ Assign jsonText
│ └─ “{ “text1” : John, “text2” : Lewis, “text3” : Jimmy}”
├─ Assign formattedJson
formattedJson of type JObject
│ └─ Newtonsoft.Json.JsonConvert.DeserializeObject(Of Newtonsoft.Json.Linq.JObject)(jsonText)
├─ Assign formattedString
│ └─ Newtonsoft.Json.JsonConvert.SerializeObject(formattedJson, Newtonsoft.Json.Formatting.Indented)
└─ Write Line formattedString

Hi @besakkiappan46

Try this

Text1.Split(",")

O/P:

image

I hope it helps!!

Hi @besakkiappan46 ,
You can use
String.Split(“,”)
Regards,
LNV

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