Is it this what do you wanna do?
public class SplitName {
public static void main(String[] args) {
String name = "Jordan, Michael";
String lastname = "";
int low = 0;
int high = name.length()-1;
String x = "";
while(low <high){
if(name.charAt(low) != ',')
lastname += name.charAt(low);
x += name.charAt(high);
low++;
high -- ;
}
StringBuffer firstname = new StringBuffer(x).reverse();
System.out.println(lastname);
System.out.print(firstname);
}
}
Message was edited by:
Java__Estudante>
> concatenation ....humm i don't think so , that's to
> easy .... O.o
I wouldn't assume so much. For all you know your questions may appear "too easy" to people here as well. It's not a logical conclusion that ANYTHING in forums like these must be too easy for someone to ask about it.
i didn't mean that :(
ohh it just splits ( x, y ) intoxand y ...doesn't concatenate...
Everyone should ask everything , and don't stop asking .
I didn't mean that , sorry :(
Just thought he wanted to split and not to concatenate..
Btw, does anyone could help me on my code . thank you so much [[]
Message was edited by:
Java__Estudante