/*****************************************************************/ /* Copyright 2013 Code Strategies */ /* This code may be freely used and distributed in any project. */ /* However, please do not remove this credit if you publish this */ /* code in paper or electronic form, such as on a web site. */ /*****************************************************************/ package test; import java.io.IOException; import org.apache.commons.lang.StringUtils; public class ReverseWordsTest { public static void main(String[] args) throws IOException { String str = "Let's reverse these words"; System.out.println("Original:" + str); String reversed = StringUtils.reverseDelimited(str, ' '); System.out.println("Reversed words:" + reversed); } }