I want to add an indent to a string in the text file I am writing .
Below is the output I am getting.
{
"Value": [
{
"UserPrincipalName": "abc.onmicrosoft.com",
"MobilePhone": "12121212"
},
{
"UserPrincipalName": "abcde.onmicrosoft.com",
"MobilePhone": " "
},
{
"UserPrincipalName": "abc.onmicrosoft.com",
"MobilePhone": "4545457815"
}
]
}
Below is the output I want.
{
"Value": [
{
"UserPrincipalName": "abc.onmicrosoft.com",
"MobilePhone": "12121212"
},
{
"UserPrincipalName": "abcde.onmicrosoft.com",
"MobilePhone": " "
},
{
"UserPrincipalName": "abc.onmicrosoft.com",
"MobilePhone": "4545457815"
}
]
}
I tried by adding \t but still, the last three brackets are not getting indented.
string.Format("{0}\n{1}{2}\n{3}\n{4}", "{", " \"Value\": [", " " + json, " ]", "}");
How can I achieve the above?
Thanks in Advance.