1##
2# capitalize() - Converts the first character to upper case
3# casefold() - Converts string into lower case
4# center() - Returns a centered string
5# count() - Returns the number of times a specified value occurs in a string
6# encode() - Returns an encoded version of the string
7# endswith() - Returns true if the string ends with the specified value
8# expandtabs() - Sets the tab size of the string
9# find() - Searches the string for a specified value and returns the position of where it was found
10# format() - Formats specified values in a string
11# format_map() - Formats specified values in a string
12# index() - Searches the string for a specified value and returns the position of where it was found
13# isalnum() - Returns True if all characters in the string are alphanumeric
14# isalpha() - Returns True if all characters in the string are in the alphabet
15# isdecimal() - Returns True if all characters in the string are decimals
16# isdigit() - Returns True if all characters in the string are digits
17# isidentifier() - Returns True if the string is an identifier
18# islower() - Returns True if all characters in the string are lower case
19# isnumeric() - Returns True if all characters in the string are numeric
20# isprintable() - Returns True if all characters in the string are printable
21# isspace() - Returns True if all characters in the string are whitespaces
22# istitle() - Returns True if the string follows the rules of a title
23# isupper() - Returns True if all characters in the string are upper case
24# join() - Joins the elements of an iterable to the end of the string
25# ljust() - Returns a left justified version of the string
26# lower() - Converts a string into lower case
27# lstrip() - Returns a left trim version of the string
28# maketrans() - Returns a translation table to be used in translations
29# partition() - Returns a tuple where the string is parted into three parts
30# replace() - Returns a string where a specified value is replaced with a specified value
31# rfind() - Searches the string for a specified value and returns the last position of where it was found
32# rindex() - Searches the string for a specified value and returns the last position of where it was found
33# rjust() - Returns a right justified version of the string
34# rpartition() - Returns a tuple where the string is parted into three parts
35# rsplit() - Splits the string at the specified separator, and returns a list
36# rstrip() - Returns a right trim version of the string
37# split() - Splits the string at the specified separator, and returns a list
38# splitlines() - Splits the string at line breaks and returns a list
39# startswith() - Returns true if the string starts with the specified value
40# strip() - Returns a trimmed version of the string
41# swapcase() - Swaps cases, lower case becomes upper case and vice versa
42# title() - Converts the first character of each word to upper case
43# translate() - Returns a translated string
44# upper() - Converts a string into upper case
45# zfill() - Fills the string with a specified number of 0 values at the beginning
46###
47
1# ways to dfefine string in python
2string = "String"
3string = str(string)
4
5# Can Add strings
6s1 = "Str"
7s2 = "ing"
8s = s1 + s2 # "String"
1#A string is a type of data. There are many data types. It can be manipulated.
2#It can be storerd as a variable
3myString = "Hello world"
4#WE can print it:
5print(myString)
6#You can append it to arraY:
7myArr = []
8myArr.append(myString)
9#You can find the index of a character in a string:
10H = myString[0]
11#You can use methods on it:
12lowercase = myString.lower()
13#You can convert it into a integer provided it is a numerical string
14myInt = int(myString)
15#So thats the basics, hope i haven't left anything out.
1string1 = "something"
2string2 = 'something else'
3string3 = """
4something
5super
6long
7"""