MIS 304 Lecture Notes - Lecture 14: Substring

46 views2 pages

Document Summary

Length of a string: variable = len(string) Strings are immutable: you cannot use an expression in the form of string[index] on the left side of the assignment operator. Use in and and not in to determine whether one string is contained in another string. All of the alphabetic letters in the string are lowercase. All of the alphabetic letters in the string are uppercase. String contains at least one alphabetic letter. String modification methods: although strings are immutable, they have methods that return modified versions of themselves. Any character that is already lowercase, or is not an alphabetic letter, is unchanged. Lstrip(char): removes all instances of char at the beginning of the string. Rstrip(char): removes all instances of char at the end of the string. Strip(): removes all leading and trailing whitespace characters. Strip(char): removes all instances of char that appear at the beginning and the end of the string.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents