Strip control codes and extended characters from a string: Difference between revisions

m
added whitespace, added related tasks.
(→‎{{header|Wren}}: More efficient.)
m (added whitespace, added related tasks.)
Line 1:
{{task}}
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:
 
;Task:
* a string with control codes stripped (but extended characters not stripped)
* a string withStrip control codes and extended characters strippedfrom a string.
 
 
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:
In ASCII, the control codes have decimal codes 0 through to 31 and 127. On an ASCII based system, if the control codes are stripped, the resultant string would have all of its characters within the range of 32 to 126 decimal on the ASCII table.
:*   a string with control codes stripped (but extended characters not stripped)
:*   a string with control codes and extended characters stripped
 
 
In ASCII, the control codes have decimal codes 0 through to 31 and 127.
 
In ASCII, the control codes have decimal codes 0 through to 31 and 127. On an ASCII based system, if the control codes are stripped, the resultant string would have all of its characters within the range of 32 to 126 decimal on the ASCII table.
 
On a non-ASCII based system, we consider characters that do not have a corresponding glyph on the ASCII table (within the ASCII range of 32 to 126 decimal) to be an extended character for the purpose of this task.
 
{{Template:Strings}}
<br><br>