I have a to do this:
AccountList.Split(vbCrLf)
In c# AccountList is a string. How can i do?
thanks
This question is related to
c#
list
split
language-comparisons
Add a reference to Microsoft.VisualBasic to your project.
Then insert the using statement
using Microsoft.VisualBasic;
Use the defined constant vbCrLf:
private const string myString = "abc" + Constants.vbCrLf;
try this:
AccountList.Split(new String[]{"\r\n"},System.StringSplitOptions.None);
or
AccountList.Split(new String[]{"\r\n"},System.StringSplitOptions.RemoveEmptyEntries);
AccountList.Split("\r\n");
I think that "\r\n" should work fine
"FirstLine" + "<br/>" "SecondLine"
I typically abbreviate so that I can use several places in my code. Near the top, do something like this:
string nl = System.Environment.NewLine;
Then I can just use "nl" instead of the full qualification everywhere when constructing strings.
Are you looking for
Source: Stackoverflow.com