Remove non-letters from a string

From CodeCodex

Revision as of 19:08, 14 June 2007 by 62.231.243.136 (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]|[ !@#\\$%\\^