Java中的字符串截取(substring)的使用


import java.util.*;
public class ZiFu {
public static void main(String args[]){
System.out.println("请输入你要截取的字符串:");
Scanner scan=new Scanner(System.in); String word=scan.next();
System.out.println(word+"的首位字符为"+word.substring(0,1));
System.out.println(word+"的末尾字符为"+word.substring(word.length()-1)); }
}
上一篇:[UE4]使用PlayerController获取鼠标点击时的坐标


下一篇:创建Maven项目时提示web.xml is missing and is set to true错误解决方案