📜  Rexx-字符串

📅  最后修改于: 2020-11-02 03:59:59             🧑  作者: Mango


Rexx中的字符串由一系列字符。以下程序是字符串的示例-

/* Main program */ 
a = "This is a string" 
say a

上面程序的输出如下-

This is a string 

让我们讨论一下Rexx中可用于字符串的一些方法。

Sr.No. Methods available in Rexx for Strings
1 left

This method returns a certain number of characters from the left of the string.

2 right

This method returns a certain number of characters from the right of the string.

3 length

This method returns the number of characters in the string.

4 reverse

This method returns the characters in a reverse format.

5 compare

This method compares 2 strings. Returns “0” if “string1” and “string2” are identical. Otherwise, it returns the position of the first character that does not match.

6 copies

This method copies a string n number of times.

7 substr

This method gets a sub string from a particular string.

8 pos

This method returns the position of one string within another.

9 delstr

This method deletes a sub string from within a string.