Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

Remove spaces at the beginning and at the end of a string

# Remove spaces at the beginning and at the end of a sting
txt = "   Hello World   "
print(txt.strip())

# Output - "Hello World"
 
PREVIOUS NEXT
Tagged: #Remove #spaces #beginning #string
ADD COMMENT
Topic
Name
5+6 =