Skip to main content
Engineering LibreTexts

24.4: Character Functions

  • Page ID
    54402
  • \( \newcommand{\vecs}[1]{\overset { \scriptstyle \rightharpoonup} {\mathbf{#1}} } \) \( \newcommand{\vecd}[1]{\overset{-\!-\!\rightharpoonup}{\vphantom{a}\smash {#1}}} \)\(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\) \(\newcommand{\id}{\mathrm{id}}\) \( \newcommand{\Span}{\mathrm{span}}\) \( \newcommand{\kernel}{\mathrm{null}\,}\) \( \newcommand{\range}{\mathrm{range}\,}\) \( \newcommand{\RealPart}{\mathrm{Re}}\) \( \newcommand{\ImaginaryPart}{\mathrm{Im}}\) \( \newcommand{\Argument}{\mathrm{Arg}}\) \( \newcommand{\norm}[1]{\| #1 \|}\) \( \newcommand{\inner}[2]{\langle #1, #2 \rangle}\) \( \newcommand{\Span}{\mathrm{span}}\)\(\newcommand{\AA}{\unicode[.8,0]{x212B}}\)

    The following table provides a list of intrinsic functions that can be used for characters/strings.

    Function Description
    ACHAR(I) Returns the character represented by integer argument I based on the ASCII table (Appendix A). Integer argument I must be between 1 and 127.
    IACHAR(C) Returns the integer value of the character argument C represented by ASCII table (Appendix A).
    LEN(STR) Returns the integer value representing the length of string argument STR.
    LEN_TRIM(STR) Returns the integer value representing the length of string argument STR excluding any trailing spaces.
    LGE(STR1,STR2) Returns the logical true, if STR1 \(\geq\) STR2 and false otherwise.
    LGT(STR1,STR2) Returns the logical true, if STR1 \(>\) STR2 and false otherwise.
    LLE(STR1,STR2) Returns the logical true, if STR1 \(\leq\) STR2 and false otherwise.
    LLT(STR1,STR2) Returns the logical true, if STR1 \(>\) STR2 and false otherwise.
    TRIM(STR) Returns the string based on the string argument STR with any trailing spaces removed.
    ADJUSTL(STR) Return a string modified by removing leading spaces. Spaces are inserted at the end of the string as needed.
    ADJUSTR(STR) Return a string modified by removing trailing spaces. Spaces are inserted at the beginning of the string as needed.

    This page titled 24.4: Character Functions is shared under a CC BY-NC-SA 3.0 license and was authored, remixed, and/or curated by Ed Jorgensen via source content that was edited to the style and standards of the LibreTexts platform; a detailed edit history is available upon request.

    • Was this article helpful?