Remove non-letters from a string

From CodeCodex

Revision as of 23:18, 11 April 2007 by 200.238.102.162 (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]|[ !@#\\$%\\^