I have this method that below that Returns String of Id's separated by '|' operator. Now I would like to add on this if and Id is null or blank replace with just single quotes (''). Not sure how to do that. How can i modify this method to do that. public static string getString(Set<Id> setId) { String strId = ''; if(setId != null && setId.size() > 0 ) { for(Id RecordId :setId) { String strRecordId = RecordId; if(strRecordId.length() > 15){ strRecordId = strRecordId.substring(0,15); } strRecordId = '\''+ strRecordId + '\''; strId += strRecordId + '|'; } strId = strId.removeEnd('|'); } return strId; }