On Jan 11, 5:10 pm, Rene Olgers <[email protected]> wrote: > Hi all, > > trying to split an array (String) I get an error. > > String[] firstname = names.split(" "); > Do I have to import something? No, split is a method of String which is inside java.lang package which is imported by default, but if names is an array you have to get at the desired element of the array before applying split to it, something along: names[i].split(" ");
Michèle Garoche -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/javaprogrammingwithpassion?hl=en
