0
1 condition:
String str = "2d5";
String[] temp;
String delimiter = "d";
temp = str.split(delimiter);
String a=temp[0];
String b=temp[1];
Integer q,w,e;
q=Integer.parseInt(a);
w=Integer.parseInt(b);
e=q*w;
for(int i =q; i <=e ; i++){ //values will be (2,3.4,5,6,7,8,9,10)
data.add(new Card(i));} //data is an arraylist and Card is a class, here values will be stored in an arraylist)
2nd Condition:
str = ""2d5-2;
delimiter = "d|\\-";
temp = str.split(delimiter);
String a=temp[0];
String b=temp[1];
String c=temp[2];
q=Integer.parseInt(a);
w=Integer.parseInt(b);
r=Integer.parseInt(c);
for(int i =0; i < r ; i++){
data1.add(data.get(0)); // data1 is another arraylist
data.remove(0); // values will be removed from arraylist stating from index 0 i.e (4,5,6,7,8,9,10)
}
は、ここで私が実際にやってみたかった私は、「D」区切り文字で文字列を分割するたびに、私はで文字列を分割するとき、私はまた、実行するための第一条件を望んでいたということです「 - 」私は第二の条件が同じで実行したかった区切り文字クラス。区切り文字で区切られたループの条件を設定するにはどうすればよいですか?
次の2つの条件を必要とする理由あなたのループ条件については、その後全く違う??はっきり言って何が必要なのか/最終的なo/p? –