\ at the end of every linelen(varS) => Returns length of stringvarS[N] => Returns character at (N+1)th occurrencevarS[N1:N2] => Returns character from N1 to (N2-1)varS[:N2] => Returns character from 0 to (N2-1)varS[N1:] => Returns character from N1 to (length of string - 1)varS[N1:-N2] => Returns character from N1 to (length of string - N2 - 1)varS[N1:-N2] => Returns character from N1 to (length of string - N2 - 1)varS[-N1:-N2] => Returns character from (length of string - N1) to (length of string - N2 - 1)varS[N1:N2:N3] => Returns characters from N1 to N2-1 in N3 ordervarS.upper() => Returns string in upper casevarS.lower() => Returns string in lower casevarS.rstrip("character") => Returns string with trailing given characters removedvarS.replace("varS1", "varS2") => Returns string with all occurrence of string1 replaced with string2varS.split('character') => Returns list of values of string separated by given charactervarS.capitalize() => Returns string with first character turned uppercase and rest lowercasevarS.center(N) => Aligns the string to the center by filling remaining with spacesvarS.count("varS1") => Returns counts of number of times the given value occursvarS.find("varS1") => Returns index of first occurrence of given value, -1 if not presentvarS.index("varS1") => Like find method but raises an exception if value is not foundvarS.swapcase() => Returns string with cases of characters swappedvarS.title() => Returns string with first character of each word capitalizedvarS.endswith("varS1") => Returns boolean True if string ends with given valuevarS.endswith("varS1", N1, N2) => Checks after slicing stringvarS.startswith("varS1") => Returns boolean True if string starts with given valuevarS.isalnum() => Returns boolean True if string only contains "A-Z", "a-z", "0-9"varS.isalpha() => Returns boolean True if string only contains "A-Z", "a-z"varS.isnumeric() => Returns boolean True if string only contains "0-9"varS.islower() => Returns boolean True if all characters are in lower casevarS.isupper() => Returns boolean True if all characters are in upper casevarS.isprintable() => Returns boolean True if all the values within the given string are printablevarS.isspace() => Returns boolean True if all characters are spacesvarS.istitle() => Returns boolean True if first character of each word is a capitalvarS = "value1" + "value2" => Returns joints of both string valuesvarS1.join(varS2) => Joins string2 after string1 if "val" in "value":
# statements
else:
# statements
for character in varS:
print(character)
varS.format(value1, value2) => Returns string with values of {} replaced in the string with given valuesvarS.format(value1, value2) => {0} inside string is replaced with value1 and {1} is replaced with value2varS.format(varName = value) => "varName" inside string is replaced with given valuevarS = "{varName:.Nf}" => value of "varName" when replaces will be formated to "N" decimal placesvarS = f"{varName1} {varName2}" => Use variables inside stringsvarS = f"{{varName1}}" => Prints "{varName1}"varS = f"{varName:.Nf}" => Format value