c#字符串中的某个特定位置的字符
string str = "Hello, World!"; char character = str[6]; // 取索引为6的字符,结果为'W' Console.WriteLine(character); // 输出: W
string s = "011101";
s[i] == '0';//i为字符的位置
字符串长度
string example = "Hello, World!"; int length = example.Length; Console.WriteLine(length); // 输出:13
浙公网安备 33010602011771号