package two;java
import java.util.Scanner;app
public class TestTwo {spa
public static void Testtwo(String str) {it
// TODO Auto-generated method stubio
String[] strArr = str.split("\\s+|[,]");class
StringBuffer result = new StringBuffer();test
for(int i = strArr.length -1;i >=0; i--){import
result.append(strArr[i] + " ");im
}static
result.setCharAt(str.length()-0, (char) 0);
System.out.println("顛倒順序後的結果爲:"+result.toString());
}
}
package two;
import static org.junit.Assert.*;
import org.junit.Test;
public class TestTwoTest {
@Test
public void test() {
String str = "how are you";
TestTwo.Testtwo(str);
}
}