capitalizing 1st character of each word in a string
String rep_name = 'this is a test'; List<String> elems = rep_name.split(' '); rep_name = ''; for (String x : elems) { rep_name += x.substring(0,1).toUpperCase()+x.substring(1,x.length()) + ' '; } System.debug('>>>'+rep_name);
Replace ‘_’ with space?:
string sText = 'ancestor_concept_id'; sText = sText.replaceAll( '_', ' ');
Error, “List has no rows for assignment to SObject” ApexPages currentPage()