package Know1;
import java.util.Scanner;
public class KnowTestString {
public static int strLength(String str){
int a = str.length();//获取字符串的长度即有几个字符
return a;
}
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
System.out.println("输入一个字符串:");
String str = sc.next();
System.out.println(strLength(str));
}
}