C# string.Split对于换行符的分隔正确用法

tmpCase
"11117144-8c91-4817-9b92-99ec2f9d784a\r\n23D95A26-012C-4332-8FE0-05B2B4279DC4\r\nA27127CA-B9C4-4090-B274-015972600AB1\r\n38DF94E9-0391-44D7-9A30-07AA963E5E5C"
tmpCase.Split(new string[]{"\\r\\n"},StringSplitOptions.RemoveEmptyEntries)
{string[]}
[]: "11117144-8c91-4817-9b92-99ec2f9d784a\r\n23D95A26-012C-4332-8FE0-05B2B4279DC4\r\nA27127CA-B9C4-4090-B274-015972600AB1\r\n38DF94E9-0391-44D7-9A30-07AA963E5E5C"
tmpCase.Split(new string[]{@"\r\n"},StringSplitOptions.RemoveEmptyEntries)
{string[]}
[]: "11117144-8c91-4817-9b92-99ec2f9d784a\r\n23D95A26-012C-4332-8FE0-05B2B4279DC4\r\nA27127CA-B9C4-4090-B274-015972600AB1\r\n38DF94E9-0391-44D7-9A30-07AA963E5E5C"
tmpCase.Split(new char[]{'\r','\n'},StringSplitOptions.RemoveEmptyEntries)
{string[]}
[]: "11117144-8c91-4817-9b92-99ec2f9d784a"
[]: "23D95A26-012C-4332-8FE0-05B2B4279DC4"
[]: "A27127CA-B9C4-4090-B274-015972600AB1"
[]: "38DF94E9-0391-44D7-9A30-07AA963E5E5C"

C# string.Split对于换行符的分隔正确用法-LMLPHP

04-19 18:14