We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProgramming Questions & HelpSyntax Questions › Maybe some one can use this to.....
Page Index Toggle Pages: 1
Maybe some one can use this to..... (Read 334 times)
Maybe some one can use this to.....
Mar 21st, 2010, 4:21am
 
////this really helped me to parse some simple text its a bit confusing but there was a lot
// here i didnt know

String test="one   three";

//println(test);

String[] tes=split(test," ");
ArrayList smo= new ArrayList();

for(int i=0;i<tes.length;i++){

 if(!tes[i].equals("")){
   smo.add(trim(tes[i]));
 }
 //  println(smo.get(i));
 //  String mmmm=(String)smo.get(i);
 // print("\"");
 //print(mmmm);
 // print("\"");
 //  println();
 // if(mmmm.equals("")){
 // println("fire,fire");
 //}
}

/*
String mmmm=(String)smo.get(1);
print("\"");
print(mmmm);
print("\"");
println();
if(mmmm.equals("")){
println("fire,fire");
}

*/
smo.trimToSize();
println("------------__");
for(int i=0;i<smo.size();i++){
 println(smo.get(i));
}

println(smo.size());


/*
ArrayList smo= new ArrayList();


smo.add("free");

println(smo.get(0));

String testa=(String)smo.get(0);

println(testa);


*/



//http://java.sun.com/j2se/1.4.2/docs/api/java/util/ArrayList.html

//http://java.sun.com/j2se/1.5.0/docs/api/java/lang/String.html

//http://www.baskent.edu.tr/~tkaracay/ders/prg/java/api/java/util/Arrays.html
Page Index Toggle Pages: 1