Strip control codes and extended characters from a string: Difference between revisions
Content deleted Content added
add BQN |
|||
Line 370:
</pre>
=={{header|BQN}}==
Using BQN's character arithmetic and comparison, characters are binned using <code>⍋</code> and removed if they are inside the range.
<lang bqn>StripCt←((1≠(@+0‿32)⊸⍋)∧(@+127)⊸≠)⊸/
StripCtEx←(1=(@+32‿127)⊸⍋)⊸/</lang>
<lang bqn> RP←•rand.Deal∘≠⊸⊏ # Random Permutation
(rand).Deal∘≠⊸⊏
ascii←RP @+↕256
s»ã®(Dj×\lÍt'C£rzËèv½`k7YW[¾]ÆF¥*=ïÝK§0m<Åàý!,JP%Xêÿ}8ñ¶u¿U-TúÞ
·Ä¬âç/ÃøªÎ#VÁ;Û ß6ÐiÜQÈ d
´ò3ÀA©üOØô&.nþ°³ö^c9ºa«2q1NæÖõä ¦
wZóp""Ç+éS¨ "
≠ascii
256
≠StripCt ascii
223
≠StripCtEx ascii
95
unicode←RP @+↕1000
"kȺ=<ɘΙͷƤ̀ÿʅ Ɂ
ϋǒǩƽͱñȤȔ˯BVȱĶțŁ̅Ġ˄ͦ_ǸǦǂɫɒŦˏτȍ5ȒNļʛˁhĹȅǔʣͯĄż̜̍̕Œdz͒ɹĵǖΤÐ)F±-ǿď͚ƒʵ̈́Ȳ̮ʷːΘ̊ʑĞ©ȗŕƟƹƁˤƩɦΡ̴@ʇ˃ʽ˜UęOīNj1ϐΰŊ¿\ʞ8ʒȧ˾ƭķɡ͠#ǥȀšJŻ͛ȇǷcνĦǑƿƖ!ēö§ɎľêϘK¼ȋȮȕƓ×ȴȝȾȰÕÇ˸͐´ɝ·ȨŐƯ͎ʉΑ$>ʍʬɮΓeÛʋͽʥŨYÖ͇ͮƷ̾͌ƚP£ρŔόɊ̗σŝͲʤώɓ˙ɀͅǯɤʦιΥÁû̓ž˒ξƢĪ̂̋ͩȫ̥̖͑7ĝÄΕı͆ØQ˘ɐƑő̼»̇űŚĒ²ĴT,Ȃ¯ϓυúɆɽÈˮ̏͡Ɛʭ̷˿ãąΧƌħǨŖ̱ɟ/Ǣɸπ π̻
˖áčĈʔŠǪgΦ̑ƇʜƬĢέɲ͖ƈ͙ĚɇȖȩĆǽ̞ˑˬ^ʫϑĂEĜǝɜĨȭɈśœ˽şʲDž͗ηɬ˧ßʮA̪ϧͤΒǭ̈ĿɏŹDŽɗūʌͶ""ίʢɶʂʰˉÆ{Êʟ͓ͬɔŎΉϖθǻƅƛ̯ɃΪ̒ʈΐ˚ǁ̰¶Ȣɼ˶Ĕˢƫϛάɩ̣̄¬˦ʻÓ̙ɕ̘ëƘ̠˝˞ŽʙÑâŶŧϤ̟ªqƱi͂Ÿ˲ΛĖ˭ƾ̶ϟǞƉ̡W:nj͉̆ʚȎ¥ͥήxƗ˫ȟǘʸʡ¢̹u̎mĊˠÂϜͰƥʼnw3ϊȏϕí˨̲Ƃϣ˺à͜Ο̩ɖ˔%͍ǗƕʺćD͏ơψ½Ôχ˕Ú˴ʹͣΞHȶ˟ϥǹ
ȥ΄LjͿå¸ʗ0ėČlˡ̭DzîȜκŏþγyɚ͢Ǿ˅ʿ̓òŮ«͵ư*̨ϏǧŜ ͈ˇɿͫljğ˱ŞƔƍÎİǠƺς
`ʴ;ƣ̦ȿˋʊƋ̢˩ºůŭè Ȉ}jŤʐƜrɾ˥˓˼Þ[̺˛˳pìʏ́ěRǟɨƴ̝ɣǺʆÍƼÏζȷɛǫǶʧï̽õüȌɌ̳˪ɥƪDZøɄɻĘéņ?Řȳ̚
ȵΖƳɪ̃ł;ǰϦăCňȦ˹tÝċʎ9ϚμńΎεʨðɋ΅aɂįNJ˻Ȫ͕ύĮǮȐǬŅƃĭɉĤǐͧƮΜvƙƏƻǣĬϢŌˍλƀƦ¡ȠǤ·ȹZôLŵƲ̿α2ſʃµÅĕȞșͭo ř̬ź¹ǛƠŪβȑƶ+ȚȻbŲäƝͪfȘ̀ÀĉϡǙǍ "
≠unicode
1000
≠StripCt unicode
967
≠StripCtEx unicode
95</lang>
=={{header|Bracmat}}==
<lang bracmat>( "string of ☺☻♥♦⌂, may include control
|