c#中如何取字符串最左边和最右边的字符

2025-05-11 23:26:00
推荐回答(1个)
回答(1):

很简单:

string s = "ABCDE";
char 最左边字符 = s[0];
char 最右边字符 = s[s.Length - 1];