此内容没有您所选择的语言版本。

9.9. String functions


The following are string functions you can use.

9.9.1. isinstr

General syntax:
isinstr:long (s1:string, s2:string)
This function returns 1 if string s1 contains string s2, otherwise zero.

9.9.2. strlen

General syntax:
strlen:long (str:string)
This function returns the number of characters in str.

9.9.3. strtol

General syntax:
strtol:long (str:string, base:long)
This function converts the string representation of a number to an integer. The base parameter indicates the number base to assume for the string (e.g. 16 for hex, 8 for octal, 2 for binary).

9.9.4. substr

General syntax:
substr:string (str:string, start:long, stop:long)
This function returns the substring of str starting from character position start and ending at character position stop.

9.9.5. text_str

General syntax:
text_str:string (input:string)
This function accepts a string argument. Any ASCII characters in the string that are not printable are replaced by a corresponding escape sequence in the returned string.

9.9.6. text_strn

General syntax:
text_strn:string (input:string, len:long, quoted:long)
This function accepts a string of length len. Any ASCII characters that are not printable are replaced by a corresponding escape sequence in the returned string. If quoted is not null, the function adds a backslash character to the output.

9.9.7. tokenize

General syntax:
tokenize:string (input:string, delim:string)
This function returns the next non-empty token in the given input string, where the tokens are delimited by characters in the delim string. If the input string is non-NULL, it returns the first token. If the input string is NULL, it returns the next token in the string passed in the previous call to tokenize. If no delimiter is found, the entire remaining input string is returned. It returns NULL when no more tokens are available.
Red Hat logoGithubRedditYoutubeTwitter

学习

尝试、购买和销售

社区

关于红帽文档

通过我们的产品和服务,以及可以信赖的内容,帮助红帽用户创新并实现他们的目标。

让开源更具包容性

红帽致力于替换我们的代码、文档和 Web 属性中存在问题的语言。欲了解更多详情,请参阅红帽博客.

關於紅帽

我们提供强化的解决方案,使企业能够更轻松地跨平台和环境(从核心数据中心到网络边缘)工作。

© 2024 Red Hat, Inc.