Access string operation function access string operation function

Source: Internet
Author: User
Access string operation functions

1. ASC
Description: return the acⅱ Value of the letter.
Example: Select ASC ("A") returns 65

2. CHR
Description: converts ASCII values to characters.
Example: Select CHR (65) returns ""

3. Format
Description: format a string.
For example, select format (now (), "yyyy-mm-dd") returns a value similar to "2008-04-03"
Select format (3/9, "0.00") returns 0.33

4. instr
Description: queries the first position of the substring in the string. No 0 is returned.
Example: Select instr ("ABC", "A") returns 1

5. lcase
Description: returns the string in lowercase.
Example: Select lcase ("ABC") returns "ABC"

6. Left
Description: truncates a string from the left.
Example: Select left ("ABC", 1) returns ""

7. Len
Description: returns the string length.
Example: Select Len ("ABC hello") returns 5

8. ltrim
Note: spaces are left intercepted.
Example: Select ltrim ("111") returns "111"

9. Mid
Returns a substring.
Example: Select mid ("ABCD", 1, 2) returns "AB"

10. Right
Description: truncates a string from the right.
Example: select right ("ABC", 1) returns "C"

11. rtrim
Description: truncates spaces on the right.
Example: select right ("ABC") returns "ABC"

12. Space
Note: space is generated.
For example, select space (5) returns five spaces.

13. strcomp
Note: compare whether the two strings are consistent (Case Insensitive)
For example, select strcomp ("ABC", "ABC") returns 0.
Select strcomp ("ABC", "123") returns-1

14. Trim
Description: truncates spaces at both ends of a string.
Example: Select trim ("ABC") returns "ABC"

15. ucase
Converts a string to uppercase.
Example: Select ucase ("ABC") returns "ABC"

1. ASC
Description: return the acⅱ Value of the letter.
Example: Select ASC ("A") returns 65

2. CHR
Description: converts ASCII values to characters.
Example: Select CHR (65) returns ""

3. Format
Description: format a string.
For example, select format (now (), "yyyy-mm-dd") returns a value similar to "2008-04-03"
Select format (3/9, "0.00") returns 0.33

4. instr
Description: queries the first position of the substring in the string. No 0 is returned.
Example: Select instr ("ABC", "A") returns 1

5. lcase
Description: returns the string in lowercase.
Example: Select lcase ("ABC") returns "ABC"

6. Left
Description: truncates a string from the left.
Example: Select left ("ABC", 1) returns ""

7. Len
Description: returns the string length.
Example: Select Len ("ABC hello") returns 5

8. ltrim
Note: spaces are left intercepted.
Example: Select ltrim ("111") returns "111"

9. Mid
Returns a substring.
Example: Select mid ("ABCD", 1, 2) returns "AB"

10. Right
Description: truncates a string from the right.
Example: select right ("ABC", 1) returns "C"

11. rtrim
Description: truncates spaces on the right.
Example: select right ("ABC") returns "ABC"

12. Space
Note: space is generated.
For example, select space (5) returns five spaces.

13. strcomp
Note: compare whether the two strings are consistent (Case Insensitive)
For example, select strcomp ("ABC", "ABC") returns 0.
Select strcomp ("ABC", "123") returns-1

14. Trim
Description: truncates spaces at both ends of a string.
Example: Select trim ("ABC") returns "ABC"

15. ucase
Converts a string to uppercase.
Example: Select ucase ("ABC") returns "ABC"

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.