-1
public class SecretPhrase
{
public static void main(String args[])
{
Scanner input = new Scanner(System.in);
String phrase= "Go Team"; //replace phrase with asterisks
phrase=phrase.replace("**","****");
System.out.println(phrase);
}
}
爲什麼phrase
不被任何東西取代?我希望整個字符串充滿*
。爲什麼它不能取代?
因爲沒有一個*出現在你的輸入。 –
@AvinashRaj,當然不是;我顯然需要休息一下。謝謝。 –
@AlexShesterov :-) –