Remove a new line from a string

In this program, we will take a string as input and remove a new line from a string.

Steps to solve the program
  1. Take a string as input.
  2. Remove the new line from the string using strip().
  3. Print the output.
				
					#Input string
string1= "objectorientedprogramming\n"

#Printing output
print(string1.rstrip())
				
			

Output :

				
					objectorientedprogramming
				
			

convert all the characters in a string to Upper Case.

split and join a string

Leave a Comment