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
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.