Java Code Examples for org.apache.commons.lang3.StringUtils#reverseDelimited()

The following examples show how to use org.apache.commons.lang3.StringUtils#reverseDelimited() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: ReverseStringExamples.java    From tutorials with MIT License 4 votes vote down vote up
public static String reverseTheOrderOfWordsUsingApacheCommons(String sentence) {
    return StringUtils.reverseDelimited(sentence, ' ');
}
 
Example 2
Source File: StringUtilsUnitTest.java    From tutorials with MIT License 4 votes vote down vote up
@Test
public void givenString_whenReversingWithDelimiter_thenCorrect() {
    String originalString = "www.baeldung.com";
    String reversedString = StringUtils.reverseDelimited(originalString, '.');
    assertEquals("com.baeldung.www", reversedString);
}