- 问答
- 2019-05-18 09:19:42 @
import java.io.PrintStream;
import java.util.Scanner;
public class Main {
public static void main(String[] args) throws java.io.UnsupportedEncodingException {
PrintStream ps = new PrintStream(System.out, true, "UTF-8");
Scanner in = new Scanner(System.in, "UTF-8");
String str=in.next();
String result;
switch (str) {
case "获取某一个位置的字符":
result = "charAt";
case "判断字符串内容是否相同":
result ="equal";
case "比较大小":
result="compareTo";
case "得到子串":
result="substring";
case "寻找字符":
result="indexof";
case "判断是否以xxx开始":
result="startsWith";
case "全部转成大写":
result="toUpperCase";
case "全部转成小写":
result="toLowerCase";
case "获得长度":
result="length";
default:
result = "你输入是不是搞错了?";
break;
}
ps.println(result);
}
}
2 条评论
-
小熊 (wlnirvana) LV 8 MOD @ 2019-05-19 23:00:47
。。。。。
-
2019-05-18 09:31:19@
好狗,第一个就不给你打
break;
- 1