code: private static int strAppender(String[] _text, StringBuilder _sbResult, int _beginIdx, int _len) {
          if (_text == null || _sbResult == null) {
              return -1;
          }
          if (_beginIdx > _text.length) {
              return _text.length;
          }
          int i = _beginIdx;
          for (i = _beginIdx; i < _text.length; i++) {  // current token length + current buffer length
              if (_sbResult.length() < _len) {
                  int condition = _text[i].length() + _sbResult.length();
                  boolean firstOrLastToken = true;
                  if (i <= _text.length -1 && _sbResult.length() > 0) { // add one char (for trailing space) if result is not empty and we are not on the first token
                      condition += 1; // + 1 (for space)
                      firstOrLastToken = false;
                  }
                  if (condition <= _len) {
                      if (!firstOrLastToken) { // append a space if result is not empty and we are not on the first token
                          _sbResult.append(" ");
                      }
                      _sbResult.append(_text[i]);
                  } else {
                      i-=1;
                      break;
                  }
              } else {
                  if (i > _beginIdx) {
                      i-=1;
                  }
                  break;
              }
          }
  
          return i;
      }
docs: Internally used by smartStringSplit to recombine the string until the expected length is reached.
  
  @param _text string array to process
  @param _sbResult resulting line
  @param _beginIdx start index of string array
  @param _len line length
  @return last position in string array or -1 if _text or _sbResult is null