Here you can find the source of extractStringsAroundDots(String s)
private static List extractStringsAroundDots(String s)
//package com.java2s; /*//from w ww.ja va2s . c om * Copyright 2001-2008 Aqris Software AS. All rights reserved. * * This program is dual-licensed under both the Common Development * and Distribution License ("CDDL") and the GNU General Public * License ("GPL"). You may elect to use one or the other of these * licenses. */ import java.util.ArrayList; import java.util.List; public class Main { /** Example: "1.3" => a list that contains "1" and "3" */ private static List extractStringsAroundDots(String s) { List result = new ArrayList(); int pos = 0; while (s.indexOf('.', pos) >= 0) { int nextPos = s.indexOf('.', pos) + 1; result.add(s.substring(pos, nextPos - 1)); pos = nextPos; } result.add(s.substring(pos)); return result; } }