Strip control codes and extended characters from a string

From Rosetta Code
Revision as of 06:29, 5 June 2011 by rosettacode>Markhobley (initial draft)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Strip control codes and extended characters from a string is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

The task is to strip control codes and extended characters from a string. The solution should demonstrate how to achieve each of the following results:

  • a string with control codes stripped (but extended characters not removed)
  • a string with control codes and extended characters removed

Ascii

In ascii, the control codes have decimal codes 0 through to 31 and the extended characters have decimal codes greater than 127. On an ascii based system, if the control codes and the extended characters are stripped, the resultant string would have all of its characters within the range of 32 to 127 on the ascii table.