Here you can find the source of getPartOfString(String string, int index, String delimiter)
public static String getPartOfString(String string, int index, String delimiter)
//package com.java2s; //License from project: Open Source License import java.util.Scanner; public class Main { public static String getPartOfString(String string, int index, String delimiter) {//from w ww . java2 s. c o m Scanner scanner = new Scanner(string).useDelimiter(delimiter); for (int i = 1; i < index; i++) { scanner.next(); } return scanner.next(); } }