Skip to content

Understanding strings as a data structure #6

@space-otter

Description

@space-otter

Definition: Ordered, immutable sequences of characters.

Syntax: s = "hello"

Common operations & properties:

  • Slicing: s[1:4]
  • Concatenation: s + " world"
  • Repetition: s * 3
  • Find: s.find("l")
  • Replace: s.replace("e", "a")
  • Split/Join: s.split(), ' '.join(...)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions