snowflake.snowpark.functions.insert¶
- snowflake.snowpark.functions.insert(base_expr: Union[Column, str], position: Union[Column, int], length: Union[Column, int], insert_expr: Union[Column, str]) Column [source] (https://github.com/snowflakedb/snowpark-python/blob/v1.16.0/src/snowflake/snowpark/functions.py#L2978-L2996)¶
Replaces a substring of the specified length, starting at the specified position, with a new string or binary value.
Examples:
>>> df = session.create_dataframe(["abc"], schema=["a"]) >>> df.select(insert(df["a"], 1, 2, lit("Z")).alias("insert")).collect() [Row(INSERT='Zc')]