As i used split method in my local Machine(jdk1.4) it was working fine.., When i try to use in the server(which is jdk1.3 version) unable to support it..,
As i m able to do it with StringTokenizer but it was not considering the Gaps..,
Example:
String Str="1,XYZ,Delt astreet,,US";
when i use in split method by giving split(",");work ing fine and storing a array.
if i try to use the following code.., it was storing null..,
StringTokenizer st=new StringTokenizer (str,",");
int count=st.countT okens();
String Array[]=new String[count];
for(;i<count;i+ +)
{
Array[i] = st.nextToken();
}
for(int k=0;k<count;k++ )
{
System.out.prin tln(Array[k]);
}
My output should be same as the input.., and it should store ",," also... but it unable to do that..,
Can anybody please help this as i m in very urgency..,
Thanks in Advance....
As i m able to do it with StringTokenizer but it was not considering the Gaps..,
Example:
String Str="1,XYZ,Delt astreet,,US";
when i use in split method by giving split(",");work ing fine and storing a array.
if i try to use the following code.., it was storing null..,
StringTokenizer st=new StringTokenizer (str,",");
int count=st.countT okens();
String Array[]=new String[count];
for(;i<count;i+ +)
{
Array[i] = st.nextToken();
}
for(int k=0;k<count;k++ )
{
System.out.prin tln(Array[k]);
}
My output should be same as the input.., and it should store ",," also... but it unable to do that..,
Can anybody please help this as i m in very urgency..,
Thanks in Advance....
Comment