String 类的常用方法有哪些?
What are common methods of the String class?
题目类型: 技术面试题
这是一道技术面试题,常见于澳洲IT公司面试中。
难度: easy
分类: Java
标签: String, API
参考答案摘要
答案 length() :获取字符串长度。 charAt(int index) :获取指定索引位置的字符。 substring(int beginIndex, int endIndex) :截取子串。 indexOf(String str) :返回指定子串第一次出现的位置。 trim() :去掉字符串首尾空格。 replace(char oldChar, char newChar) / repla...
本题提供 STAR 原则详细解答和技术解析,登录匠人学院学习中心即可查看完整答案。