diff --git a/crates/polars-sql/src/functions.rs b/crates/polars-sql/src/functions.rs index 87b0656d171d..2755fddc7001 100644 --- a/crates/polars-sql/src/functions.rs +++ b/crates/polars-sql/src/functions.rs @@ -393,7 +393,7 @@ pub(crate) enum PolarsSQLFunctions { /// ``` StrPos, /// SQL 'substr' function - /// Returns a portion of the data (first character = 0) in the range. + /// Returns a portion of the data (first character = 1) in the range. /// \[start, start + length] /// ```sql /// SELECT SUBSTR(column_1, 3, 5) FROM df; diff --git a/py-polars/docs/source/reference/sql/functions/string.rst b/py-polars/docs/source/reference/sql/functions/string.rst index 02ca13fd740b..555e696f8dc6 100644 --- a/py-polars/docs/source/reference/sql/functions/string.rst +++ b/py-polars/docs/source/reference/sql/functions/string.rst @@ -45,8 +45,8 @@ String - Returns the index of the given substring in the target string. * - :ref:`STRPTIME ` - Converts a string to a Datetime using a strftime-compatible formatting string. - * - :ref:`SUBSTRING ` - - Returns a portion of the data (first character = 0) in the range [start, start + length]. + * - :ref:`SUBSTR ` + - Returns a portion of the data (first character = 1) in the range [start, start + length]. * - :ref:`TIMESTAMP ` - Converts a formatted timestamp/datetime string to an actual Datetime value. * - :ref:`UPPER ` @@ -617,9 +617,9 @@ Converts a string to a Datetime using a `chrono strftime