0

i having the string array,, String[] strrr=null; String[] aa ;
aa=strrr[3].split("\!"); if i debug this it shows source not found
but i want to return from the string if the strrr[3] value having
null or 0 ,how to do it,, use above three line of code to check
it,exactly what i want is i dont want any exceptions at the third
line of above , how to do it

3
Contributors
4
Replies
5
Views
5 Years
Discussion Span
Last Post by Majestics
0

1) strrr object isnt intialized yet, u have initialze it first.
strrr = new String[size];
2) Now u can check your string, if its null dont split.

0

actually i got string from server so i want to check the string is null or not , how to do it

aa=strrr[3].split("!");

i want to check strr[3] is null or not

1

All yu need is if (strr[3] == null)
... but if strr has not been initialised or is less than 4 elements in size you will need to deal with those possibilities before trying to use strr[3]

0

1) Check wether main string is null (if(str != null)) then
2) After that get the length of Str, if it is more then 3 then check if(str[3] == null) then
.........................................................................................

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.