class_docstr: A column in a DataFrame.
  
  .. versionadded:: 1.3.0
  
  .. versionchanged:: 3.4.0
      Supports Spark Connect.
  
  Examples
  --------
  Column instances can be created by
  
  >>> df = spark.createDataFrame(
  ...      [(2, "Alice"), (5, "Bob")], ["age", "name"])
  
  Select a column out of a DataFrame
  >>> df.name
  Column<'name'>
  >>> df["name"]
  Column<'name'>
  
  Create from an expression
  
  >>> df.age + 1
  Column<...>
  >>> 1 / df.age
  Column<...>
class_docstr_tok: ["A","column","in","a","DataFrame",".","..","versionadded",":",":","1.3.0","..","versionchanged",":",":","3.4.0","Supports","Spark","Connect",".","Examples","--","--","--","--","Column","instances","can","be","created","by",">",">",">","df","=","spark.createDataFrame","(","...","[","(","2",",","``","Alice","''",")",",","(","5",",","``","Bob","''",")","]",",","[","``","age","''",",","``","name","''","]",")","Select","a","column","out","of","a","DataFrame",">",">",">","df.name","Column","<","'name","'",">",">",">",">","df","[","``","name","''","]","Column","<","'name","'",">","Create","from","an","expression",">",">",">","df.age","+","1","Column","<","...",">",">",">",">","1","\/","df.age","Column","<","...",">"]
docstr: Return a :class:`Column` which is a substring of the column.
  
  .. versionadded:: 1.3.0
  
  .. versionchanged:: 3.4.0
      Supports Spark Connect.
  
  Parameters
  ----------
  startPos : :class:`Column` or int
      start position
  length : :class:`Column` or int
      length of the substring
  
  Returns
  -------
  :class:`Column`
      Column representing whether each element of Column is substr of origin Column.
  
  Examples
  --------
  
  Example 1. Using integers for the input arguments.
  
  >>> df = spark.createDataFrame(
  ...      [(2, "Alice"), (5, "Bob")], ["age", "name"])
  >>> df.select(df.name.substr(1, 3).alias("col")).collect()
  [Row(col='Ali'), Row(col='Bob')]
  
  Example 2. Using columns for the input arguments.
  
  >>> df = spark.createDataFrame(
  ...      [(3, 4, "Alice"), (2, 3, "Bob")], ["sidx", "eidx", "name"])
  >>> df.select(df.name.substr(df.sidx, df.eidx).alias("col")).collect()
  [Row(col='ice'), Row(col='ob')]
docstr_tok: ["Return","a",":","class",":","`","Column","`","which","is","a","substring","of","the","column",".","..","versionadded",":",":","1.3.0","..","versionchanged",":",":","3.4.0","Supports","Spark","Connect",".","Parameters","--","--","--","--","--","startPos",":",":","class",":","`","Column","`","or","int","start","position","length",":",":","class",":","`","Column","`","or","int","length","of","the","substring","Returns","--","--","--","-",":","class",":","`","Column","`","Column","representing","whether","each","element","of","Column","is","substr","of","origin","Column",".","Examples","--","--","--","--","Example","1",".","Using","integers","for","the","input","arguments",".",">",">",">","df","=","spark.createDataFrame","(","...","[","(","2",",","``","Alice","''",")",",","(","5",",","``","Bob","''",")","]",",","[","``","age","''",",","``","name","''","]",")",">",">",">","df.select","(","df.name.substr","(","1",",","3",")",".alias","(","``","col","''",")",")",".collect","(",")","[","Row","(","col='Ali","'",")",",","Row","(","col='Bob","'",")","]","Example","2",".","Using","columns","for","the","input","arguments",".",">",">",">","df","=","spark.createDataFrame","(","...","[","(","3",",","4",",","``","Alice","''",")",",","(","2",",","3",",","``","Bob","''",")","]",",","[","``","sidx","''",",","``","eidx","''",",","``","name","''","]",")",">",">",">","df.select","(","df.name.substr","(","df.sidx",",","df.eidx",")",".alias","(","``","col","''",")",")",".collect","(",")","[","Row","(","col='ice","'",")",",","Row","(","col='ob","'",")","]"]
code: def substr(
      self, startPos: Union[int, "Column"], length: Union[int, "Column"]
  ) -> "Column":
      """
      Return a :class:`Column` which is a substring of the column.
  
      .. versionadded:: 1.3.0
  
      .. versionchanged:: 3.4.0
          Supports Spark Connect.
  
      Parameters
      ----------
      startPos : :class:`Column` or int
          start position
      length : :class:`Column` or int
          length of the substring
  
      Returns
      -------
      :class:`Column`
          Column representing whether each element of Column is substr of origin Column.
  
      Examples
      --------
  
      Example 1. Using integers for the input arguments.
  
      >>> df = spark.createDataFrame(
      ...      [(2, "Alice"), (5, "Bob")], ["age", "name"])
      >>> df.select(df.name.substr(1, 3).alias("col")).collect()
      [Row(col='Ali'), Row(col='Bob')]
  
      Example 2. Using columns for the input arguments.
  
      >>> df = spark.createDataFrame(
      ...      [(3, 4, "Alice"), (2, 3, "Bob")], ["sidx", "eidx", "name"])
      >>> df.select(df.name.substr(df.sidx, df.eidx).alias("col")).collect()
      [Row(col='ice'), Row(col='ob')]
      """
      if type(startPos) != type(length):
          raise PySparkTypeError(
              error_class="NOT_SAME_TYPE",
              message_parameters={
                  "arg_name1": "startPos",
                  "arg_name2": "length",
                  "arg_type1": type(startPos).__name__,
                  "arg_type2": type(length).__name__,
              },
          )
      if isinstance(startPos, int):
          jc = self._jc.substr(startPos, length)
      elif isinstance(startPos, Column):
          jc = self._jc.substr(startPos._jc, cast("Column", length)._jc)
      else:
          raise PySparkTypeError(
              error_class="NOT_COLUMN_OR_INT",
              message_parameters={
                  "arg_name": "startPos",
                  "arg_type": type(startPos).__name__,
              },
          )
      return Column(jc)
  
imports: import sys
  import json
  import warnings
  from typing import cast, overload, Any, Callable, Iterable, List, Optional, Tuple, TYPE_CHECKING, Union
  from py4j.java_gateway import JavaObject, JVMView
  from pyspark import copy_func
  from pyspark.context import SparkContext
  from pyspark.errors import PySparkAttributeError, PySparkTypeError, PySparkValueError
  from pyspark.sql.types import DataType
  from pyspark.sql.utils import get_active_spark_context
label_desc: Use image node_id 17 for calling the Column obj's underlying member method code with example usage: obj.substr(startPos, length) and returns: Column