Product Documentation
Cadence SKILL Language Reference
Product Version IC23.1, November 2023

strpbrk

strpbrk( 
t_str1
t_str2
) 
=> t_subStr / nil

Description

Returns a substring of the first occurence in t_str1 of any character from the string pointed to by t_str2

Arguments

t_str1

Specifies the string that you need to scan

t_str2

Specifies the pattern that you need to match

Value Returned

t_substr

Returns a substring of the first occurence of any character specified in t_str2

nil

Returns nil if no occurence of any character from t_str2 is found in t_str1

Examples

s="world"
strpbrk(s "o")
=> "orld"
strpbrk(s "sssssl")
=>"ld"
strpbrk(s "ss")
=> nil
strpbrk("WORLD" "world")
=> nil
strpbrk("WORLD" " ")

=> nil

Related Topics

String Functions

strcat

strcmp


Return to top
 ⠀
X