System.outprintln(s.substring(3,3)); //empty string
System.outprintln(s.substring(3,2)); //exception
substring(indexStart)
substring(indexStart, indexEnd)
输出:1c-true
比较两个String的时候不用==,而用equals()。
==比较的是两个对象的地址,equals比较的才是string里的内容。
写小说也写代码,左手架空世界,右手现实逻辑。
📚 欢迎来看博客,起点同笔名在写小说,欢迎来找我玩。