You are viewing documentation about an older version (1.3.0). View latest version

snowflake.snowpark.functions.insert

snowflake.snowpark.functions.insert(base_expr: ColumnOrName, position: Column | int, length: Column | int, insert_expr: ColumnOrName) Column[source]

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')]
Copy