= 2) { String resultString = originalString.substring(2); System.out.println("去掉前两个字符后" />
java去掉前两个字符串
144
2024-03-11 02:54
public class RemoveFirstTwoChars {
public static void main(String[] args) {
String originalString = "HelloWorld";
if (originalString.length() >= 2) {
String resultString = originalString.substring(2);
System.out.println("去掉前两个字符后的字符串为:" + resultString);
} else {
System.out.println("字符串长度不足,无法去掉前两个字符");
}
}
}
顶一下
(0)
踩一下
(0)