from facebook, i want to fetch Hometown details . from it i want to saparate city,state, country <p>From facebook, i want to fetch Hometown details . from it i want to separate city,state, country. These fields are separated by comma. so i can split them by comma.</p> <p>my problem is: as soon i enter city name in hometown field of facebook, it is giving combination of city,state and country. but sometime it is giving combination of city and country so, when i split this string by comma, how to i know that second element is state or country.</p> <p>I can do one thing, i can check the length of array, if it has three filed then it has city/state/county. else city/county.</p> <p>Is this ture? can it have more files.</p>