Skip to content
Menu
Code for Java c
  • Home
  • Java
    • Java Examples
    • Java tutorials
  • C
    • C tutorials
    • C Examples
  • C++
    • C++ Tutorials
    • C++ Examples
  • Python
    • Python Tutorials
    • Python Examples
  • About
    • About me
    • contact us
    • disclaimer
    • Privacy Policy
Code for Java c

Python basic String pre-defined function

Posted on June 18, 2017September 15, 2019

Table of Contents

  • Python basic String pre-defined function
      •         1. str.lower() – This function is used to convert from upper case letter to lower case letter.
    • Related

Python basic String pre-defined function

In this tutorial, we will discuss the basic String pre-defined function.

Python language has several pre-defined or built-in string function for string data type

        1. str.lower() – This function is used to convert from upper case letter to lower case letter.

 

Python basic String pre-defined function
str.lower() function
2. str.upper() – This function is used to convert from lower case letter to upper case letter.
 
 
Python basic String pre-defined function
str.upper() function
       3.  str.join() – This function is used to concatenate two or more string in python.
                       This function is used to join the white spaces in this string
Python basic String pre-defined function
str.jion() function

                      this function used to join “,” set of this string
        4. str.split() – This function is used to split two or more string in python
Python basic String pre-defined function
str.split() function
       5.  len() – This function is used for the length of the given string in python
        Output
         35
       6. index() This function is used to find the index of given string

Output

4
(‘index of given string’, 4)

   7. count() This function is used to count given string

             2
               (‘count “s” given string’, 2)

 

          8. slice function is used to slice the given range of string
                 slice
                 (‘slice string’, ‘ str’)
          9. reverse function is used to reverse given string
                output
                (‘reverse string’, ‘gnirts esrever’)
        10. capitalize function is used to capitalalise the first letter of the given  string 
           Output
         This is capitalized function
     11. Find function is used to find part of the string from the given  string
 
         Output
 
                8
      12. islower() function is used to find  the lower caseof  all of the string from the given  string
 
      13. islower() function is used to find the upper case of all of the string from the given  string
 
 14. replace() function is used to replace one string with another
 
 15. strip() function returns a string with all spaces removed from start till end
Python basic String pre-defined function
str.strp() function

Related

Recent Posts

  • Multiply two numbers in Java using scanner| 5 different ways
  • 5 different ways to Divide two numbers in Java using scanner
  • Learn 8 Ways to Subtract Two Numbers Using Methods in Java
  • 10 ways to subtract two numbers in Java
  • Java Code Examples – Multiply Two Numbers in 5 Easy Ways
  • How to Divide two numbers in Java| 5 different ways

tag

Addition (8) Array (38) C++ language (91) C language (98) c sharp (23) Division (8) Function (29) if else (32) Java language (108) JavaScript (5) loops (138) Multiply (8) Oop (2) patterns (66) PHP (13) Python Language (38) Subtraction (9) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2026 Code for Java c | Powered by SuperbThemes