Hi Eranga,
Thank you for the response. I am trying to avoid using a for loop for each set, because I may end up with 36+ sets of characters that I may need to combine together.
I am looking for a solution that will allow this flexibility without using multiple for loops.
Originally Posted by
Eranga
I'll give a simple code here. Here the output developed by using characters. So have to think about a way to concatenate those characters and make as strings.
public class StringTest
{
public static void main(String[] arguments)
{
String s1 = "abc";
String s2 = "123";
int s1Len = s1.length();
int s2Len = s2.length();
for(int temp1 =0;temp1 < s1Len;temp1++)
{
for(int temp2 = 0;temp2 < s2Len;temp2++)
{
char ch1=s1.charAt(temp1);
System.out.print(ch1);
char ch2=s2.charAt(temp2);
System.out.println(ch2);
}
}
}
}
Check there how final strings are obtained using print() and println()