class_docstr: Series.str namespace.
class_docstr_tok: ["Series.str","namespace","."]
docstr: Create subslices of the string values of a String Series.
  
  Parameters
  ----------
  offset
      Start index. Negative indexing is supported.
  length
      Length of the slice. If set to `None` (default), the slice is taken to the
      end of the string.
  
  Returns
  -------
  Series
      Series of data type :class:`Struct` with fields of data type
      :class:`String`.
  
  Examples
  --------
  >>> s = pl.Series("s", ["pear", None, "papaya", "dragonfruit"])
  >>> s.str.slice(-3)
  shape: (4,)
  Series: 's' [str]
  [
      "ear"
      null
      "aya"
      "uit"
  ]
  
  Using the optional `length` parameter
  
  >>> s.str.slice(4, length=3)
  shape: (4,)
  Series: 's' [str]
  [
      ""
      null
      "ya"
      "onf"
  ]
docstr_tok: ["Create","subslices","of","the","string","values","of","a","String","Series",".","Parameters","--","--","--","--","--","offset","Start","index",".","Negative","indexing","is","supported",".","length","Length","of","the","slice",".","If","set","to","`","None","`","(","default",")",",","the","slice","is","taken","to","the","end","of","the","string",".","Returns","--","--","--","-","Series","Series","of","data","type",":","class",":","`","Struct","`","with","fields","of","data","type",":","class",":","`","String","`",".","Examples","--","--","--","--",">",">",">","s","=","pl.Series","(","``","s","''",",","[","``","pear","''",",","None",",","``","papaya","''",",","``","dragonfruit","''","]",")",">",">",">","s.str.slice","(","-3",")","shape",":","(","4",",",")","Series",":","'s","'","[","str","]","[","``","ear","''","null","``","aya","''","``","uit","''","]","Using","the","optional","`","length","`","parameter",">",">",">","s.str.slice","(","4",",","length=3",")","shape",":","(","4",",",")","Series",":","'s","'","[","str","]","[","``","''","null","``","ya","''","``","onf","''","]"]
code: def slice(self, offset: int, length: int | None = None) -> Series:
      """
      Create subslices of the string values of a String Series.
  
      Parameters
      ----------
      offset
          Start index. Negative indexing is supported.
      length
          Length of the slice. If set to `None` (default), the slice is taken to the
          end of the string.
  
      Returns
      -------
      Series
          Series of data type :class:`Struct` with fields of data type
          :class:`String`.
  
      Examples
      --------
      >>> s = pl.Series("s", ["pear", None, "papaya", "dragonfruit"])
      >>> s.str.slice(-3)
      shape: (4,)
      Series: 's' [str]
      [
          "ear"
          null
          "aya"
          "uit"
      ]
  
      Using the optional `length` parameter
  
      >>> s.str.slice(4, length=3)
      shape: (4,)
      Series: 's' [str]
      [
          ""
          null
          "ya"
          "onf"
      ]
  
      """
  
imports: from __future__ import annotations
  from typing import TYPE_CHECKING
  from polars.series.utils import expr_dispatch
  from polars.utils.deprecation import deprecate_renamed_function, deprecate_renamed_parameter
label_desc: Use image node_id 38 for calling the StringNameSpace obj's underlying member method code with example usage: obj.slice(offset, length) without return types