Java String Split by Delimiter split(String str, String regexDelim, int limitUseRegex)

Here you can find the source of split(String str, String regexDelim, int limitUseRegex)

Description

Cutting a character string following a delimiter, with a limited use of delimiter "limitUseRegex" times.

License

Open Source License

Parameter

Parameter Description
limitUseRegex limit use regex
regexDelim the regex delim
str the str

Return

the list

Declaration

public static List<String> split(String str, String regexDelim, int limitUseRegex) 

Method Source Code

//package com.java2s;
/*/*from   w  w w  . j a  v  a 2  s .  com*/
 * Copyright ? WebServices pour l'?ducation, 2014
 *
 * This file is part of ENT Core. ENT Core is a versatile ENT engine based on the JVM.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU Affero General Public License as
 * published by the Free Software Foundation (version 3 of the License).
 *
 * For the sake of explanation, any module that communicate over native
 * Web protocols, such as HTTP, with ENT Core is outside the scope of this
 * license and could be license under its own terms. This is merely considered
 * normal use of ENT Core, and does not fall under the heading of "covered work".
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 */

import java.util.Arrays;
import java.util.List;

public class Main {
    /**
     * Cutting a character string following a delimiter.
     * 
     * @param regexDelim the regex delim
     * @param str the str
     * 
     * @return the list<string>
     */
    public static List<String> split(String str, String regexDelim) {
        return Arrays.asList(str.split(regexDelim));
    }

    /**
     * Cutting a character string following a delimiter, with a limited use of delimiter "limitUseRegex" times.
     * 
     * @param limitUseRegex limit use regex
     * @param regexDelim the regex delim
     * @param str the str
     * 
     * @return the list<string>
     */
    public static List<String> split(String str, String regexDelim, int limitUseRegex) {
        return Arrays.asList(str.split(regexDelim, limitUseRegex));
    }
}

Related

  1. split(String str, String delimiter)
  2. split(String str, String delimiter)
  3. split(String str, String delimiter)
  4. split(String str, String delimiter, int limit)
  5. split(String str, String delims)
  6. split(String string, String delim, boolean doTrim)
  7. split(String string, String delimiter)
  8. split(String string, String delimiter)
  9. split(String stringToSplit, char delimiter)