C# custom string split library,
Are their any 开发者_StackOverflowcustom c# string split scripts, that will enable a string to be split but still retain the split characters in each of the split strings.
For example, if I split "ABCD CRLF ABC" with first string retaining the carriage return/line feed resulting in two strings:
ABCD CRLF
ABC
Bob.
I think what you're after is
string[] lines = Regex.Split(inputString, @"(?<=\r\n)(?!$)");
精彩评论