Looking on input types that a EditText view can have i seen “textPersonName” and i try to search a way to (if possible) split name and surname using maybe a method like editText.getName. My question is exist a method of edittext that splits name and surname in edittext? And if don’t exist the best way is to use split or else?
Share
The
textPersonNameis just a style option, for instance it capitalizes the first letter of each word. It won’t help you distinguish first and last names. However you can search for spaces, for instance:The Array of Strings will have each name in a different String. If the user entered:
John Doeyou would have “John” innames[0]and “Doe” innames[1].