10. String Operations
💡
原文约100字/词,阅读约需1分钟。
📝
内容提要
代码示例展示了三个字符串操作:首先,将字符串转换为大写,得到“JOHN”;其次,将“John”和“Doe”连接为“John Doe”;最后,使用`string.Compare()`比较“Apple”和“Banana”,结果为-1,表示“Apple”小于“Banana”。
🎯
关键要点
- 将字符串转换为大写,结果为'JOHN'。
- 将'John'和'Doe'连接为'John Doe'。
- 使用string.Compare()比较'Apple'和'Banana',结果为-1,表示'Apple'小于'Banana'。
➡️