Giter Site home page Giter Site logo

python-string-manipulation's Introduction

python-string-manipulation

Python has quite a few methods that string objects can call to perform frequency occurring task (related to string). For example, if you want to capitalize the first letter of a string, you can use capitalize() method.

The page contains all methods of string objects. Also, the page includes built-in functions that can take string as a parameter and perform some task. For example, len() method returns the length of the string passed as a parameter to this function.

Method Description
capitalize() Converts first character to Capital Letter
center() Pads string with specified character
casefold() converts to casefolded strings
count() returns occurrences of substring in string
endswith() Checks if String Ends with the Specified Suffix
expandtabs() Replaces Tab character With Spaces
encode() returns encoded string of given string
find() Returns the index of first occurrence of substring
format() formats string into nicer output
index() Returns Index of Substring
isalnum() Checks Alphanumeric Character
isalpha() Checks if All Characters are Alphabets
isdecimal() Checks Decimal Characters
isdigit() Checks Digit Characters
isidentifier() Checks for Valid Identifier
islower() Checks if all Alphabets in a String are Lowercase
isnumeric() Checks Numeric Characters
isprintable() Checks Printable Character
isspace() Checks Whitespace Characters
istitle() Checks for Titlecased String
isupper() returns if all characters are uppercase characters
join() Returns a Concatenated String
ljust() returns left-justified string of given width
rjust() returns right-justified string of given width
lower() returns lowercased string
upper() returns uppercased string
swapcase() swap uppercase characters to lowercase; vice versa
lstrip() Removes Leading Characters
rstrip() Removes Trailing Characters
strip() Removes Both Leading and Trailing Characters
partition() Returns a Tuple
maketrans() returns a translation table
rpartition() Returns a Tuple
translate() returns mapped charactered string
replace() Replaces Substring Inside
rfind() Returns the Highest Index of Substring
rindex() Returns Highest Index of Substring
split() Splits String from Left
rsplit() Splits String From Right
splitlines() Splits String at Line Boundaries
startswith() Checks if String Starts with the Specified String
title() Returns a Title Cased String
zfill() Returns a Copy of The String Padded With Zeros
format_map() Formats the String Using Dictionary
any() Checks if any Element of an Iterable is True
all() returns true when all elements in iterable is true
ascii() Returns String Containing Printable Representation
bool() Converts a Value to Boolean
bytearray() returns array of given byte size
bytes() returns immutable bytes object
compile() Returns a
complex() Creates a Complex Number
enumerate() Returns an Enumerate Object
filter() constructs iterator from elements which are true
float() returns floating point number from number, string
input() reads and returns a line of string
int() returns integer from a number or string
iter() returns iterator for an object
len() Returns Length of an Object
max() returns largest element
min() returns smallest element
map() Applies Function and Returns a List
ord() returns Unicode code point for Unicode character
reversed() returns reversed iterator of a sequence
slice() creates a slice object specified by range()
sorted() returns sorted list from a given iterable
sum() Add items of an Iterable
zip() Returns an Iterator of Tuples

python-string-manipulation's People

Contributors

hcvazquez avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.