snowflake.snowpark.functions.instr¶
- snowflake.snowpark.functions.instr(str: Union[Column, str], substr: str)[source]¶
Locate the position of the first occurrence of substr column in the given string. Returns null if either of the arguments are null.
- Example::
>>> df = session.create_dataframe([["hello world"], ["world hello"]], schema=["text"]) >>> df.select(instr(col("text"), "world").alias("position")).collect() [Row(POSITION=7), Row(POSITION=1)]