Tabnine Logo
StringUtility.splitString
Code IndexAdd Tabnine to your IDE (free)

How to use
splitString
method
in
com.aoindustries.util.StringUtility

Best Java code snippets using com.aoindustries.util.StringUtility.splitString (Showing top 18 results out of 315)

origin: com.aoindustries/aocode-public

/**
 * Splits a string on the given delimiter.
 * Does include all empty elements on the split.
 *
 * @param  words  the words will be added to this collection.
 *
 * @return  the collection provided in words parameter
 */
public static <C extends Collection<String>> C splitString(String line, char delim, C words) {
  return splitString(line, 0, line.length(), delim, words);
}
origin: com.aoindustries/aocode-public

/**
 * Splits a string on the given delimiter over the given range.
 * Does include all empty elements on the split.
 *
 * @return  the modifiable list from the split
 */
public static List<String> splitString(String line, int begin, int end, char delim) {
  return splitString(line, begin, end, delim, new ArrayList<String>());
}
origin: com.aoindustries/aocode-public

/**
 * Splits a string on the given delimiter.
 * Does include all empty elements on the split.
 *
 * @return  the modifiable list from the split
 */
public static List<String> splitString(String line, char delim) {
  return splitString(line, 0, line.length(), delim, new ArrayList<String>());
}
origin: com.aoindustries/aoserv-client

/**
 * Gets the number of addresses in an address list.  The number of addresses is equal to the number
 * of non-blank lines.
 */
public int getAddressListCount() throws IOException, SQLException {
  String list=getAddressList();
  List<String> lines=StringUtility.splitString(list, '\n');
  int count=0;
  for(String line : lines) {
    if(line.trim().length()>0) count++;
  }
  return count;
}
origin: com.aoindustries/aocode-public

private void init(String parameters, String encoding) throws UnsupportedEncodingException {
  for(String nameValue : StringUtility.splitString(parameters, '&')) {
    int pos = nameValue.indexOf('=');
    String name;
    String value;
    if(pos==-1) {
      name = URLDecoder.decode(nameValue, encoding);
      value = ""; // Servlet environment treats no equal sign same as value equal empty string - matching here
    } else {
      name = URLDecoder.decode(nameValue.substring(0, pos), encoding);
      value = URLDecoder.decode(nameValue.substring(pos+1), encoding);
    }
    addParameter(name, value);
  }
}
origin: com.semanticcms/semanticcms-core-taglib

public static Map<String,String> parseQueryString(String queryString) throws UnsupportedEncodingException {
  if(queryString==null) return null;
  String requestEncoding = ServletUtil.getRequestEncoding(getRequest());
  List<String> pairs = StringUtility.splitString(queryString, '&');
  Map<String,String> params = new LinkedHashMap<String,String>(pairs.size() * 4/3 + 1);
  for(String pair : pairs) {
    int equalPos = pair.indexOf('=');
    String name, value;
    if(equalPos==-1) {
      name = URLDecoder.decode(pair, requestEncoding);
      value = "";
    } else {
      name = URLDecoder.decode(pair.substring(0, equalPos), requestEncoding);
      value = URLDecoder.decode(pair.substring(equalPos + 1), requestEncoding);
    }
    if(!params.containsKey(name)) params.put(name, value);
  }
  return params;
}
origin: com.aoindustries/aoserv-client

/**
 * Gets the ticket category in "/ path" form.
 */
private TicketCategory getTicketCategory(String path) throws IllegalArgumentException, IOException, SQLException {
  TicketCategory tc = null;
  for(String name : StringUtility.splitString(path, '/')) {
    TicketCategory newTc = connector.getTicketCategories().getTicketCategory(tc, name);
    if(newTc==null) {
      if(tc==null) throw new IllegalArgumentException("Unable to find top-level TicketCategory: "+name);
      else throw new IllegalArgumentException("Unable to TicketCategory: "+name+" in "+tc);
    }
    tc = newTc;
  }
  if(tc==null) throw new IllegalArgumentException("Unable to find TicketCategory: "+path);
  return tc;
}
origin: com.aoindustries/aoserv-client

public static Integer getIntForIPAddress(String ipAddress) throws IllegalArgumentException {
  Integer result = intForIPAddressCache.get(ipAddress);
  if(result==null) {
    // There must be four octets with . between
    List<String> octets=StringUtility.splitString(ipAddress, '.');
    if(octets.size()!=4) throw new IllegalArgumentException("Invalid IP address: "+ipAddress);
    // Each octet should be from 1 to 3 digits, all numbers
    // and should have a value between 0 and 255 inclusive
    for(int c=0;c<4;c++) {
      String tet=octets.get(c);
      int tetLen=tet.length();
      if(tetLen<1 || tetLen>3) throw new IllegalArgumentException("Invalid IP address: "+ipAddress);
      for(int d=0;d<tetLen;d++) {
        char ch=tet.charAt(d);
        if(ch<'0' || ch>'9') throw new IllegalArgumentException("Invalid IP address: "+ipAddress);
      }
      int val=Integer.parseInt(tet);
      if(val<0 || val>255) throw new IllegalArgumentException("Invalid IP address: "+ipAddress);
    }
    result =
      (Integer.parseInt(octets.get(0))<<24)
      | (Integer.parseInt(octets.get(1))<<16)
      | (Integer.parseInt(octets.get(2))<<8)
      | (Integer.parseInt(octets.get(3))&255)
    ;
    Integer existing = intForIPAddressCache.putIfAbsent(ipAddress, result);
    if(existing!=null) result = existing;
  }
  return result;
}
origin: com.aoindustries/aoserv-client

final int lineNum = c+1;
String line = lines.get(c);
List<String> fields = StringUtility.splitString(line, '\t');
if(fields.size()!=6) throw new ParseException(
  accessor.getMessage(
origin: com.aoindustries/aoserv-client

for(int i=0, numLines=lines.size(); i<numLines; i++) {
  String line = lines.get(i);
  List<String> columns = StringUtility.splitString(line, "\",\"");
  if(columns.size() != 15) throw new IOException("Line does not have 15 columns: " + columns.size());
  String mountPoint = columns.get(0);
origin: com.aoindustries/aoserv-client

for(String line : lines) {
  lineNum++;
  List<String> values = StringUtility.splitString(line, '\t');
  if(values.size() != 3) {
    throw new ParseException(
origin: com.aoindustries/aoserv-client

nameWords=StringUtility.splitString(name);
int len = nameWords.length;
for (int c = 0; c < len; c++) nameWords[c]=nameWords[c].toLowerCase();
versionWords = StringUtility.splitString(version);
int len = versionWords.length;
for (int c = 0; c < len; c++) versionWords[c]=versionWords[c].toLowerCase();
origin: com.aoindustries/aoserv-client

final int lineNum = c+1;
String line = lines.get(c);
List<String> fields = StringUtility.splitString(line, '\t');
if(fields.size()!=5) throw new ParseException(
  accessor.getMessage(
origin: com.semanticcms/semanticcms-autogit-servlet

if(result.getExitVal() != 0) throw new IOException("Unable to get status: " + result.getStderr());
List<String> split = new ArrayList<>(StringUtility.splitString(result.getStdout(), (char)0));
if(!split.isEmpty()) {
origin: com.aoindustries/aoserv-client

for(String line : lines) {
  lineNum++;
  List<String> values = StringUtility.splitString(line, '\t');
  if(values.size() != 7) {
    throw new ParseException(
origin: com.aoindustries/aoserv-client

final int lineNum = c+1;
final String line = lines.get(c);
final List<String> fields = StringUtility.splitString(line, '\t');
if(fields.size()!=7) throw new ParseException(
  accessor.getMessage(
final int stripeCount = Integer.parseInt(fields.get(4).trim());
final long segStartPe = Long.parseLong(fields.get(5).trim());
final List<String> segPeRanges = StringUtility.splitString(fields.get(6).trim(), ' ');
origin: com.aoindustries/aoserv-client

List<String> tcolumns=StringUtility.splitString(columnName, ',');
int addPos=d--;
int numAdded=0;
  while(c<argCount) {
    String columnName=args[c++];
    List<String> exprs=StringUtility.splitString(columnName, ',');
    for(int d=0;d<exprs.size();d++) {
      String expr=exprs.get(d).trim();
origin: com.aoindustries/ao-credit-cards-authorizeNet

response = StringUtility.splitString(responseString, X_DELIM_CHAR);
if(response.size()<68) throw new Exception("Not enough fields in response");
for(int i=0; i<response.size(); i++) {
com.aoindustries.utilStringUtilitysplitString

Javadoc

Splits a String into a String[].

Popular methods of StringUtility

  • join
    Joins the string representation of objects on the provided delimiter. The iteration will be performe
  • nullIfEmpty
    Returns null if the string is null or empty.
  • getApproximateSize
    Gets the approximate size (where k=1024) of a file in this format: x byte(s) xx bytes xxx bytes x.x
  • splitStringCommaSpace
    Splits a string into multiple words on either whitespace or commas
  • convertToHex
  • getDecimalTimeLengthString
  • replace
    Replaces all occurrences of a String with a String.
  • splitLines
    Splits a String into lines on any '\n' characters. Also removes any ending '\r' characters if presen
  • compareToDDMMYYYY0
  • compareToIgnoreCaseCarefulEquals
    Compares two strings in a case insensitive manner. However, if they are considered equals in the cas
  • convertStringDateToTime
  • countOccurrences
    Counts how many times a word appears in a line. Case insensitive matching.
  • convertStringDateToTime,
  • countOccurrences,
  • getDateString,
  • getHex,
  • getHexChar,
  • getTimeLengthString,
  • indexOf,
  • leapYear,
  • wordWrap

Popular in Java

  • Finding current android device location
  • getResourceAsStream (ClassLoader)
  • putExtra (Intent)
  • startActivity (Activity)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • Permission (java.security)
    Legacy security code; do not use.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • XPath (javax.xml.xpath)
    XPath provides access to the XPath evaluation environment and expressions. Evaluation of XPath Expr
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now