Embed presentation











![© SkillBrew http://skillbrew.comSplitting12message = "enter the dragon"print message.split()Output:['enter', 'the', 'dragon']split()returns a list of words of the string](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-12-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comSplitting (2)13message = "enter-the-dragon"print message.split('-')Output:['enter', 'the', 'dragon']split(delimiter)delimiter: character or characters which we want touse to split the string, by default it will be space](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-13-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comJoining14seq_list = ['enter', 'the', 'dragon']print ''.join(seq_list)Output:enter the dragonstr.join()returns a string in which the string elements of sequence havebeen joined by str separator](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-14-2048.jpg&f=jpg&w=240)


![© SkillBrew http://skillbrew.comsplitting/joining example (2)17>>> link = 'foo.com/forum?filter=comments&num=20'>>> components = link.split('?')>>> components['foo.com/forum', 'filter=comments&num=20']>>> url = components[0]>>> qs = components[1]>>> url'foo.com/forum'>>> qs'filter=comments&num=20'Step 1Split the link using '?' asdelimiter to separate outurl and querystring](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-17-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comsplitting/joining example (3)18>>> qs'filter=comments&num=20'>>>params = qs.split('&')>>> params['filter=comments', 'num=20']Step 2Split the querystringusing '&' as delimiter](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-18-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comsplitting/joining example (4)19>>> params['filter=comments', 'num=20']>>> params[0] = 'filter=views'>>> params[1] = 'num=15'>>> params['filter=views', 'num=15']>>> qs = '&'.join(params)>>> qs'filter=views&num=15'Step 3Update the parameters andjoin them using '&' asdelimiter to formquerystring](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-19-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comsplitting/joining example (5)20>>> url'foo.com/forum'>>> qs'filter=views&num=15'>>> '?'.join([url, qs])'foo.com/forum?filter=views&num=15'>>> link = '?'.join([url, qs])>>> link'foo.com/forum?filter=views&num=15'Step 4join url and querystringusing '?' as delimiter](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-20-2048.jpg&f=jpg&w=240)




This document discusses various string methods in Python including upper(), lower(), capitalize(), startswith(), endswith(), strip(), split(), and join(). It provides examples of how to use each method, such as converting strings to uppercase and lowercase, checking if a string starts or ends with certain text, stripping leading and trailing characters, and splitting or joining strings.
This slide introduces the presentation topic focusing on common string methods in Python.
A list of common string methods in Python such as upper(), lower(), capitalize(), etc.
Details on upper(), lower(), and capitalize() methods with examples and outputs.
Explanation of the startswith() method, checking if a string starts with a specified text.
Describes startswith() method with optional begin and end parameters for boundary checking.
More examples for startswith() usage demonstrating the method's functionality.
Overview of the endswith() method, indicating if a string ends with specified text.
Covers the strip() method, which removes leading and trailing characters from a string.
Details on lstrip() method, which removes leading characters from a string.
Examines rstrip() method for removing trailing characters from a string.
Introduction to splitting and joining strings as key manipulation techniques.
Describes split() method which converts a string into a list of words.
Further explanation on using split() with a specified delimiter.
Explains join() method that combines elements of a list into a single string.
Examples of joining string elements from a tuple using a specified delimiter.
A practical example of manipulating a URL string using splitting and joining.
First step in the example to split the URL and query string.
Second step in the example focusing on splitting query string parameters.
Updating query parameters and joining them into a new query string.
Final step of joining the updated URL and query string.
Recap of all discussed string methods including upper, startswith, and splitting.
Provides resources such as Python documentation for string methods.
Completion of the presentation, indicating the end of the content.











![© SkillBrew http://skillbrew.comSplitting12message = "enter the dragon"print message.split()Output:['enter', 'the', 'dragon']split()returns a list of words of the string](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-12-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comSplitting (2)13message = "enter-the-dragon"print message.split('-')Output:['enter', 'the', 'dragon']split(delimiter)delimiter: character or characters which we want touse to split the string, by default it will be space](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-13-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comJoining14seq_list = ['enter', 'the', 'dragon']print ''.join(seq_list)Output:enter the dragonstr.join()returns a string in which the string elements of sequence havebeen joined by str separator](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-14-2048.jpg&f=jpg&w=240)


![© SkillBrew http://skillbrew.comsplitting/joining example (2)17>>> link = 'foo.com/forum?filter=comments&num=20'>>> components = link.split('?')>>> components['foo.com/forum', 'filter=comments&num=20']>>> url = components[0]>>> qs = components[1]>>> url'foo.com/forum'>>> qs'filter=comments&num=20'Step 1Split the link using '?' asdelimiter to separate outurl and querystring](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-17-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comsplitting/joining example (3)18>>> qs'filter=comments&num=20'>>>params = qs.split('&')>>> params['filter=comments', 'num=20']Step 2Split the querystringusing '&' as delimiter](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-18-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comsplitting/joining example (4)19>>> params['filter=comments', 'num=20']>>> params[0] = 'filter=views'>>> params[1] = 'num=15'>>> params['filter=views', 'num=15']>>> qs = '&'.join(params)>>> qs'filter=views&num=15'Step 3Update the parameters andjoin them using '&' asdelimiter to formquerystring](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-19-2048.jpg&f=jpg&w=240)
![© SkillBrew http://skillbrew.comsplitting/joining example (5)20>>> url'foo.com/forum'>>> qs'filter=views&num=15'>>> '?'.join([url, qs])'foo.com/forum?filter=views&num=15'>>> link = '?'.join([url, qs])>>> link'foo.com/forum?filter=views&num=15'Step 4join url and querystringusing '?' as delimiter](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fpythonprogrammingessentials-m8-stringmethods-140819043159-phpapp01%2f75%2fPython-Programming-Essentials-M8-String-Methods-20-2048.jpg&f=jpg&w=240)


