docs: public static String[] splitShortString(
          String str, char separator, char quote)
      {
          int len = (str == null) ? 0 : str.length();
          if (str == null || len == 0)
          {
              return ArrayUtils.EMPTY_STRING_ARRAY;
          }
  
          // Step 1: how many substrings?
          //      We exchange double scan time for less memory allocation
          int tokenCount = 0;
          for (int pos = 0; pos < len; pos++)
          {
              tokenCount++;
  
              int oldPos = pos;
  
              // Skip quoted text, if any
              while ((pos < len) && (str.charAt(pos) == quote))
              {
                  pos = str.indexOf(quote, pos + 1) + 1;
  
                  // pos == 0 is not found (-1 returned by indexOf + 1)
                  if (pos == 0)
                  {
                      throw new IllegalArgumentException(
                          "Closing quote missing in string '" + str + "'");
                  }
              }
  
              if (pos != oldPos)
              {
                  if ((pos < len) && (str.charAt(pos) != separator))
                  {
                      throw new IllegalArgumentException(
                          "Separator must follow closing quote in strng '"
                          + str + "'");
                  }
              }
              else
              {
                  pos = str.indexOf(separator, pos);
                  if (pos < 0)
                  {
                      break;
                  }
              }
          }
  
          // Main loop will finish one substring short when last char is separator
          if (str.charAt(len - 1) == separator)
          {
              tokenCount++;
          }
  
          // Step 2: allocate exact size array
          String[] list = new String[tokenCount];
  
          // Step 3: retrieve substrings
          // Note: on this pass we do not check for correctness,
          //       since we have already done so
          tokenCount--; // we want to stop one token short
  
          int oldPos = 0;
          for (int pos = 0, i = 0; i < tokenCount; i++, oldPos = ++pos)
          {
              boolean quoted;
  
              // Skip quoted text, if any
              while (str.charAt(pos) == quote)
              {
                  pos = str.indexOf(quote, pos + 1) + 1;
              }
  
              if (pos != oldPos)
              {
                  quoted = true;
  
                  if (str.charAt(pos) != separator)
                  {
                      throw new IllegalArgumentException(
                          "Separator must follow closing quote in strng '"
                          + str + "'");
                  }
              }
              else
              {
                  quoted     = false;
                  pos        = str.indexOf(separator, pos);
              }
  
              list[i] =
                  quoted ? dequote(str, oldPos + 1, pos - 1, quote)
                      : substring(str, oldPos, pos);
          }
  
          list[tokenCount] = dequoteFull(str, oldPos, len, quote);
  
          return list;
      }