Member-only story

Python Programming Language: String Functions

Jesse L
2 min readSep 18, 2021

--

Hi everyone, welcome back. Strings are a data type in the Python language. Strings hold a sequence of characters including letters of the alphabet, numbers, and even symbols. We’re going to take a look at some of the built in functions that Python provides that allows us to interact with strings.

String Functions

  • capitalize(): Updates the first character to become upper case
  • casefold(): Updates the entire string to become lower case
  • center(): Returns a centered string
  • count(): Returns a number of how many time a given value appears in a string
  • encode(): Returns an encoded version of the string
  • endsWith(): Checks if the string ends with a given value
  • expandtabs(): Set the tab size of the string
  • find(): Searches for a given value within the string and returns the index number of where it was found
  • format(): Formats given values within the string
  • index(): Searches for a given value within the string and returns the index number of where it was found
  • isalnum(): Checks if all characters within the string are alphanumeric
  • isalpha(): Checks if all characters…

--

--

Jesse L
Jesse L

Written by Jesse L

Hi, I'm a passionate technology enthusiast and lifelong learner. Beyond my technical pursuits, I'm also passionate about sharing my enthusiasm with others.

No responses yet