package lin.sxt;
public class StringTest {
public static void main(String[] args) {
/*String str = "dsaHGFg465565$%^&$&^fdhgfFJHFGH";
int count1=0;
int count2=0;
int count3=0;
int count4=0;
for(int i=0;i<str.length();i++)
{
char c=str.charAt(i);
if(c>='a' && c<='z')
{
count1++;
}
else if(c>='1' && c<='9')
{
count2++;
}
else if(c>='A' && c<='Z')
{
count3++;
}
else
{
count4++;
}
}
System.out.println(count1);
System.out.println(count2);
System.out.println(count3);
System.out.println(count4);
*/
//找指定的字符串
String str="javahgjhgjhjavagjkdkjgf678javajdfhgdjfgjava";
String s="java";
int count = 0;
int index = -1;
while((index=str.indexOf(s))!=-1)
{
str = str.substring(index+s.length());
count++;
}
System.out.println(count);
}
}
public class ArrayParser {
public static void main(String[] args) {
double[][] d;
String s = "1,2;3,4,5;6,7,8";
String[] sFirst = s.split(";");
d = new double[sFirst.length][];
for(int i=0; i<sFirst.length; i++) {
String[] sSecond = sFirst[i].split(",");
d[i] = new double[sSecond.length];
for(int j=0; j<sSecond.length; j++) {
d[i][j] = Double.parseDouble(sSecond[j]);
}
}
for(int i=0; i<d.length; i++) {
for(int j=0; j<d[i].length; j++) {
System.out.print(d[i][j] + " ");
}
System.out.println();
}
}
}