Java String Extract extractStrings(String s)

Here you can find the source of extractStrings(String s)

Description

extract Strings

License

Open Source License

Declaration

public static List extractStrings(String s) 

Method Source Code


//package com.java2s;
import java.util.*;

public class Main {
    private static char STRING_SEPARATOR = ':';

    public static List extractStrings(String s) {
        List strings = new ArrayList();

        if (s == null || s.equals("")) {
            return strings;
        }//www . j  av a 2s  .  co  m

        try {
            while (s.indexOf(STRING_SEPARATOR) != -1) {
                int nIndex = s.indexOf(STRING_SEPARATOR);
                strings.add(s.substring(0, nIndex));

                s = s.substring(nIndex + 1);
            }

            strings.add(s);
        } catch (IndexOutOfBoundsException ioobe) {
            // never mind.
        }

        return strings;
    }
}

Related

  1. extractPacket(String serverPacket)
  2. extractParameters(String uri)
  3. extractParamsFromUriTemplateFragment(String value)
  4. extractReferences(String value)
  5. extractStreetName(String address)
  6. extractStringsAroundDots(String s)
  7. extractTableName(String line)
  8. extractTags(Map layoutProperties)
  9. extractUmiPositions(String pattern)