开发者

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)(?!$)");
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜