5 Replies Latest reply on Dec 22, 2009 2:23 PM by 800387

    First character of a string to lowercase

      I want to rewrite the first character of a string to lowercase and I strongly suspect that there's a better/easier way of doing it than this rather elaborate way I figured (being a real beginner):
      char [] nameInChars = token[x].toCharArray();
      char lower = Character.toLowerCase(nameInChars[0]);
      String nameEdit = token[x].replace(token[x].charAt(0), ' ');
      String nameTrimmed = nameEdit.trim();
      String nameLowerCase = new StringBuilder().append(lower).append(nameTrimmed).toString();
      Suggestions would be much appreciated!

      Edited by: Igor_Pavlove on Dec 22, 2009 5:45 AM