Functions (characters and strings)

Source: Internet
Author: User

Pascal's commonly used character processing standard function has 5

(1) Ord (CH) for the ASCII code value corresponding to the character ch, such as ord (' A ') result is 65,ord (true) result is 1,ord (false) result is 0
(2) Chr (x) for x (x 1 ... 255 integers) of the asii code corresponding to the character, such as: Chr (65) result is ' A '.
(3) pred (CH) precursor function pred (' B ') result is ' A '
(4) SUCC (CH) successor function succ (' B ') result is ' C '

---------------------------------------------------------------------------------------------------------------

Pascal commonly used string processing standard function has 4

(1) Copy (str,n,m) from the left nth of the string str to intercept m characters, such as: Copy (' Pascal ', 3,2) The result is ' SC ';

(2) concat (STR1,STR2) connects two strings into a new string, such as: s:=str1+str2; equals two string of characters added

(3) Length (str) of the string str (number of characters);

(4) POS (STR1,STR2) The position of the string str1 the beginning of the string, if not found, the function value is 0. such as: POS (' SCA ', ' Pascal ') result is 3;

(5) upcase (CH) converts all characters of the string str to uppercase letters, such as the UpCase (' abc ') result as ' abc ';

---------------------------------------------------------------------------------------------------------------

Pascal commonly used string processing standard process has 4

(1) Val (str,x) converts a numeric string into a number and is stored in the variable x, such as Val (' 68|val ', x), x value is 9|val (' 9 ', x) x value is 0 (' A9 ', x) x value)

(2) str (N,S) converts the number n into a string in s, such as the result of STR (768,s) s is ' 768 ';

(3) Insert (Str1,str2,n) inserts the string str1 before the nth character of the string str2, the result is in str2; {The str2 in this procedure is a variable parameter with an incoming outgoing function};

(4) Delete (str,n,m) starts from the nth of the string str, removes the M characters, and the remaining characters are in Str, {The STR in this procedure is a variable parameter and has an incoming outgoing function};

--------------------------------------------------------------------------------------------------------------- ---

Functions (characters and strings)

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.