当前位置: 技术问答>java相关
初级小问题,希望大家帮着解决一下!
来源: 互联网 发布时间:2015-02-04
本文导语: 如何取一个字符串的长度和其中的某个字符? | String palindrome = "Dot saw I was Tod"; int len = palindrome.length(); String anotherPalindrome = "Niagara. O roar again!"; char aChar = anotherPalindrome.charAt(9); ...
如何取一个字符串的长度和其中的某个字符?
|
String palindrome = "Dot saw I was Tod";
int len = palindrome.length();
String anotherPalindrome = "Niagara. O roar again!";
char aChar = anotherPalindrome.charAt(9);
int len = palindrome.length();
String anotherPalindrome = "Niagara. O roar again!";
char aChar = anotherPalindrome.charAt(9);
|
String str = new String("abcdefg");
int len = str.length();
char ch = str.CharAt(3);
int len = str.length();
char ch = str.CharAt(3);