SAP Ariba interview question

Trim a string in Java (remove leading and trailing white space). You can't use the String.trim() function. Do it just using an array. Keep in mind the string could have white spaces within it.

Interview Answer

Anonymous

22 Nov 2012

tokenize the string with space and then join all the array values.