2017-06-01 4 views
0

パブリッククラスDemoWeBBrower { 公共の静的な無効メイン(文字列の引数[]){日食の私のコードの作品が、

String answer = "A. hold - read"; 
    String answerQuestion = ""; 

    String[] arrStr1 = answer.split("\\."); 
     String str1 = arrStr1[1]; 
      String[] Str2 = str1.split("-"); 
      answerQuestion = "Jeff _____ a book right now, he _____ a story to Linda."; 
      for (int i = 1 ; i < Str2.length +1 ; i++){ 
       answerQuestion = answerQuestion.replaceFirst("_____",Str2[(i-1)]); 
      } 



       System.out.println(answerQuestion); 


      } 
    } 

問題があるの修正方法アンドロイドスタジオでは動作しませんか?どうすれば修正できますか?

+0

は何それはアンドロイドとしなければならないとしてみてください? –

+0

何がうまくいかなかったかの詳細を提供します。 – YuVi

+0

それで、何がうまくいかないのですか?また、インデントをクリーンアップします。 –

答えて

0

は、このコード

String answer = "A. hold - read"; 
String answerQuestion = ""; 

String[] arrStr1 = answer.split("\\."); 
    String str1 = arrStr1[1]; 
     String[] Str2 = str1.split("-"); 
     answerQuestion = "Jeff _____ a book right now, he _____ a story to 
     Linda."; 
     for (int i = 0; i < Str2.length(); i++){ 
      answerQuestion = answerQuestion.replaceFirst("_____",Str2[i]); 
     } 
     System.out.println(answerQuestion); 
     } 

}

+0

それは働いている!ありがとう、そんなに仲間!しかし、私はまだ分かりません。 –

+0

あなたはあなたのコードに '()' simvolsを偽造しますが、それはEclipse上でどのように動作するのか分かりません –

関連する問題