Substring/Top and tail: Difference between revisions

Content added Content deleted
(→‎{{header|REXX}}: added the REXX language. -- ~~~~)
No edit summary
Line 7: Line 7:


If the program uses UTF-8 or UTF-16, it must work on any valid Unicode code point, whether in the Basic Multilingual Plane or above it. The program must reference logical characters (code points), not 8-bit code units for UTF-8 or 16-bit code units for UTF-16. Programs for other encodings (such as 8-bit ASCII, or EUC-JP) are not required to handle all Unicode characters.
If the program uses UTF-8 or UTF-16, it must work on any valid Unicode code point, whether in the Basic Multilingual Plane or above it. The program must reference logical characters (code points), not 8-bit code units for UTF-8 or 16-bit code units for UTF-16. Programs for other encodings (such as 8-bit ASCII, or EUC-JP) are not required to handle all Unicode characters.

=={{header|ACL2}}==
<lang Lisp>(defun str-rest (str)
(coerce (rest (coerce str 'list)) 'string))

(defun rdc (xs)
(if (endp (rest xs))
nil
(cons (first xs)
(rdc (rest xs)))))

(defun str-rdc (str)
(coerce (rdc (coerce str 'list)) 'string))

(str-rdc "string")
(str-rest "string")
(str-rest (str-rdc "string"))</lang>


=={{header|Ada}}==
=={{header|Ada}}==