Remove non-letters from a string

From CodeCodex

Revision as of 15:33, 18 September 2007 by 218.58.136.4 (Talk)

Related content:

Implementations

Java

This code removes common symbols and numbers from a string, returning letters only. (Note, not all symbols are included.)

static String lettersOnly(String s) {
   return s.replaceAll("[0-9]|[ !@#\\$%\\^