public class StringTest {
public static void main(String[] args)
{
int i =0;
for(char c: test.toCharArray())
{
System.out.println(i++ + "=" + c);
}
String sample = "akckekghkjklmnopqrstuvwxyz";
System.out.println(sample);
char c = sample.charAt(10);
System.out.println(c);
System.out.println("test "+sample.substring(0, 10));
System.out.println(getStringByReplacingTenthPosition(sample).length());
}
private static String getStringByReplacingTenthPosition(String sample) {
return sample.substring(0, 10) + " " + sample.substring(11);
}
}
public static void main(String[] args)
{
int i =0;
for(char c: test.toCharArray())
{
System.out.println(i++ + "=" + c);
}
String sample = "akckekghkjklmnopqrstuvwxyz";
System.out.println(sample);
char c = sample.charAt(10);
System.out.println(c);
System.out.println("test "+sample.substring(0, 10));
System.out.println(getStringByReplacingTenthPosition(sample).length());
}
private static String getStringByReplacingTenthPosition(String sample) {
return sample.substring(0, 10) + " " + sample.substring(11);
}
}
No comments:
Post a Comment