Day: October 28, 2018

Frequently Asked Java Program 23: Java Program to Remove Extra WhiteSpace Between Words In Given String

Problem Statement: Remove extra white spaces between words. Only one white space is allowed between words. If more than one, remove it. If given string has leading or trailing white spaces, remove them as well. Do not use trim method. Write your own logic. Example: You entered with spaces: ”       Make      […]

Frequently Asked Java Program 22: Java Program to Trim Whitespace From String Without Using Trim Method

Hello Folks, This interview question was asked in Deloitte.  Write a java program to Trim a given string without using inbuilt trim() method of String Class in Java. “trim()” method of String class trims leading and trailing whitespace/s of given string. It does not remove whitespace between words. We need to write logic to do so. […]

Please wait...

Subscribe to new posts to become automation expert

Want to be notified when my new post is published? Get my posts in your inbox.