Blog

Blog » 2019 » August » 2 » split and return first value
01:44
split and return first value

list fixCity = new list([Select Id, City__c from Contact where City__c like '%,%' LIMIT 2);
//system.debug(tweContact.size());

for (Contact c: fixCity ) {
    Set<String> city = new Set<String>();
     c.addAll(city.City__c.split(','));
    system.debug(city);
}