> hii have some quetion about regular expression.I
> have number 905544.with regular expression
> 905544.replaceAll("(.)(?!$)","$1 ");i have 9 0 5 5 4
> 4 but i want two or three tabs between numbers.if
> anyone know pleace help me
Hi Friend
I do my level . But there was a problem to converting the string into integer. It dosen't take tab a number. That is the problem.
import java.io.*;
class simple
{
public static void main(String arg[])
{
try{
String num ="905544";
System.out.println(num.charAt(0));
String s1 = num.charAt(0) + "\t";
System.out.println("S1:"+s1);
System.out.println(num.charAt(1));
String s2 = num.charAt(1) + "\t";
System.out.println("S2:"+s2);
System.out.println(num.charAt(2));
String s3 = num.charAt(2) + "\t";
System.out.println("S3:"+s3);
System.out.println(num.charAt(3));
String s4 = num.charAt(3) + "\t";
System.out.println("S4:"+s4);
System.out.println(num.charAt(4));
String s5 = num.charAt(4) + "\t";
System.out.println("S5:"+s5);
System.out.println(num.charAt(5));
String s6 = num.charAt(5) + "\t";
System.out.println("S6:"+s6);
String result = s1+s2+s3+s4+s5+s6;
System.out.println("result:"+result);
int number = Integer.parseInt(result);
System.out.println("Integer Number:"+number);
}
catch(Exception e){
System.out.println("Exception for... :"+e);
}
}
}
> > in this case i have only one tab between numbers.I
> > want two or three tab between numbers
>
> Wow! I wonder how one can solve this? Does one use
> one's brain or does one wait until someone else shows
> how it should be done?
LOL.
@Op. What do you think you need to change in my post?