Here you can find the source of firstStartsWith(List
static String firstStartsWith(List<String> lines, String startsWith)
//package com.java2s; //License from project: Open Source License import java.util.*; public class Main { /**/*from w w w. j a v a2s . c om*/ * return first line that starts with prefix, null otherwise */ static String firstStartsWith(List<String> lines, String startsWith) { for (String l : lines) { if (l.startsWith(startsWith)) { return l; } } return null; } }