I have the following line of code.
<%= Html.Encode(string.Join(", ", item.company1.companies.Select(x => x.company_name).ToArray())) %>
Would it be possible to somehow replace the comma with a line break?
I have the following line of code.
<%= Html.Encode(string.Join(", ", item.company1.companies.Select(x => x.company_name).ToArray())) %>
Would it be possible to somehow replace the comma with a line break?
Have you tried with Environment.NewLine?
<%= Html.Encode(string.Join(Environment.NewLine, item.company1.companies.Select(x => x.company_name).ToArray())) %>
or "\r\n"
<%= Html.Encode(string.Join("\r\n", item.company1.companies.Select(x => x.company_name).ToArray())) %>
EDIT TO ADD
If the companies are separated by space, the try joining the array by a space character
<%= Html.Encode(string.Join(" ", item.company1.companies.Select(x => x.company_name).ToArray())) %>
EDIT TO ADD 2
Join by a html line break
<%= Html.Encode(string.Join("<br/>", item.company1.companies.Select(x => x.company_name).ToArray())) %>
I got it.
<%= Html.Encode(string.Join("***", item.company1.companies.Select(x => x.company_name).ToArray())).Replace("***", "<br />") %>