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.

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

  • Subtract two numbers using method overriding
  • PHP Star triangle Pattern program
  • Using function or method to Write temperature conversion : Fahrenheit into Celsius
  • Function or method:temperature conversion from Fahrenheit into Celsius – Entered by user
  • Write temperature conversion program: Fahrenheit into Celsius
  • How to write a program to convert Fahrenheit into Celsius

tag

Addition (6) Array (38) C++ language (91) C language (98) c sharp (23) Division (6) Function (29) if else (32) Java language (102) JavaScript (5) loops (137) Multiply (7) Oop (2) patterns (65) PHP (13) Python Language (38) Subtraction (7) temperature (20)

Archives

Categories

Address

Global information technology

Puloly south, PointPedro

Jaffna

Srilanka

©2025 Code for Java c | Powered by SuperbThemes