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

m
Correct language markup and add signature to previous edit.
m (Cleanup markup)
m (Correct language markup and add signature to previous edit.)
Line 35:
I found this page while searching on how to remove extended ASCII codes using REXX. This helped me to get the answer but the code as presented did not remove the extended characters from even its own example here (tested on Windows and Linux, ooREXX 5.0 and 4.2 respectively).
My solution probably does not work on EBCDIC without modification but as I have no way of testing I can't say what changes would be needed.
<nowikilang rexx>/*REXX program strips all "control codes" from a character string (ASCII or EBCDIC). */
xxx= 'string of ☺☻♥♦⌂, may include control characters and other ilk.♫☼§►↔◄'
above = xrange('80'x,'FF'x) /* extended ASCII characters */
Line 45:
say 'newer = »»»'zzz"«««" /* " " " " " newer " */
/*stick a fork in it, we're all done. */
</nowikilang>
From this, I cannot see that there is any change with removing the control characters from the string specified. It could be done in one line: <code>yyy = space(translate(translate(xxx),,below),,above))</code>
I post this not as a "better" way but because, at least in the REXX implementation I used, the example code printed the old and new exactly the same with both printing the control characters.
 
--[[User:Abwillis|Abwillis]] 15:47, 20 April 2017 (UTC)
Anonymous user