Java String Split by Space splitNamespaceTitle(String fullTitle)

Here you can find the source of splitNamespaceTitle(String fullTitle)

Description

split Namespace Title

License

Open Source License

Declaration

public static String[] splitNamespaceTitle(String fullTitle) 

Method Source Code


//package com.java2s;
//License from project: Open Source License 

import java.util.*;

public class Main {
    public static final Map<String, Integer> NAMESPACE_MAP = new HashMap<String, Integer>();

    public static String[] splitNamespaceTitle(String fullTitle) {
        String[] fields = new String[2];
        fields[0] = "";
        fields[1] = fullTitle;/*from   ww w. j  a va 2 s.com*/

        int i = fullTitle.indexOf(":");
        if (i > 0) {
            String namespace = fullTitle.substring(0, i);
            Integer ns = NAMESPACE_MAP.get(namespace);
            if (ns != null) {
                fields[0] = namespace;
                fields[1] = fullTitle.substring(i + 1);
            }
        }
        return fields;
    }
}

Related

  1. split(String source, String limit, boolean trim, boolean ignoreWhitespace)
  2. splitAndKeepEscapedSpaces(String string, boolean preserveEscapes)
  3. splitAtSpaces(String s)
  4. splitBySpace(String p_str)
  5. splitInWhiteSpaces(String string)
  6. splitOnSpace(final String string)
  7. splitOnSpace(String string)
  8. SplitOnWhitespace(String instrData)
  9. splitSpaces(String input)