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

index

index( 
t_string1 
S_string2 
) 
=> t_result / nil 

Description

Returns a string consisting of the remainder of string1 beginning with the first occurrence of string2.

Arguments

t_string1

String to search for the first occurrence of S_string2.

S_string2

String to search for in t_string1.

Value Returned

t_result

If S_string2 is found in t_string1, returns a string equal to the remainder of t_string1 that begins with the first character of S_string2.

nil

If S_string2 is not found.

Examples

index( "abc" 'b )            
=> "bc"
index( "abcdabce" "dab" )    
=> "dabce"
index( "abc" "cba" )         
=> nil
index( "dandelion" "d")      
=> "dandelion"

Related Topics

String Functions

getchar


Return to top
 ⠀
X