Java String Split splitDateText(String text)

Here you can find the source of splitDateText(String text)

Description

split Date Text

License

Apache License

Declaration

static private String[] splitDateText(String text) 

Method Source Code


//package com.java2s;
//License from project: Apache License 

import java.util.ArrayList;

public class Main {
    static private String[] splitDateText(String text) {
        java.util.List<String> list = new ArrayList<String>();
        final int n = text.length();
        int i = 0;
        int j = 0;
        for (; i < n;) {
            int i0 = i;
            for (; i < n; i++) {
                char c = text.charAt(i);
                if ((j & 1) == 0 ? (c < '0' || c > '9') : (c >= '0' && c <= '9'))
                    break;
            }// ww  w .j  ava  2  s  . com
            if (i <= i0)
                break;
            list.add(text.substring(i0, i).trim());
            j++;
        }
        if (i < n)
            return null;
        return list.toArray(new String[list.size()]);
    }
}

Related

  1. splitAuthors(String source)
  2. splitBreaks(String text)
  3. splitByTypeAndName(final String s)
  4. splitCamelback(String s)
  5. splitCQLStatements(String source)
  6. splitDigits(long input)
  7. splitDomains(String domains)
  8. splitElements(String values)
  9. splitEx(String str, String spilter)