Example usage for org.apache.commons.lang.text StrBuilder substring

List of usage examples for org.apache.commons.lang.text StrBuilder substring

Introduction

In this page you can find the example usage for org.apache.commons.lang.text StrBuilder substring.

Prototype

public String substring(int startIndex, int endIndex) 

Source Link

Document

Extracts a portion of this string builder as a string.

Usage

From source file:com.applerox.jack.AppleCommands.AppleCommands.java

public static String finalArg(String[] strings, int pos) {
    StrBuilder sb = new StrBuilder();
    for (int i = pos; i < strings.length; i++) {
        sb.append(strings[i]);/*from  w  ww .j a  va2s. co  m*/
        sb.append(" ");
    }
    return sb.substring(0, sb.length() - 1);
}

From source file:org.royaldev.royalcommands.RoyalCommands.java

/**
 * Joins an array of strings with spaces
 *
 * @param array    Array to join//from  w  w  w .j  a va2 s .  c  om
 * @param position Position to start joining from
 * @return Joined string
 */
public static String getFinalArg(String[] array, int position) {
    StrBuilder sb = new StrBuilder();
    for (int i = position; i < array.length; i++) {
        sb.append(array[i]);
        sb.append(" ");
    }
    return sb.substring(0, sb.length() - 1);
}