Aonlan
03-14-2005, 05:01 AM
i have a code:
System.out.print(strWord.substring(0,1));
for (intCounter = 1; intCounter <= intStringLength-1; intCounter++){
intCounter2 = intCounter + 1;
strSubFinalWord = strWord.substring(intCounter,intCounter2);
strFinalWord = "-" + strSubFinalWord;
System.out.print(strFinalWord);
}
System.out.println("");
is it possible to not do a lot of system.out.println and system.out.print n make a string that would equal to the final product of the above
System.out.print(strWord.substring(0,1));
for (intCounter = 1; intCounter <= intStringLength-1; intCounter++){
intCounter2 = intCounter + 1;
strSubFinalWord = strWord.substring(intCounter,intCounter2);
strFinalWord = "-" + strSubFinalWord;
System.out.print(strFinalWord);
}
System.out.println("");
is it possible to not do a lot of system.out.println and system.out.print n make a string that would equal to the final product of the above