Here you can find the source of searchString(String name, ArrayList input)
Parameter | Description |
---|---|
name | a parameter |
input | a parameter |
public static String searchString(String name, ArrayList input)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; public class Main { /**// w w w .ja v a 2 s.c o m * This method searchs for a String withing an ArrayList containing strings. * * @param name * @param input * @return */ public static String searchString(String name, ArrayList input) { boolean found = false; int i = 0; while ((found == false) && (i < input.size())) { if (((String) input.get(i)).equals(name)) { found = true; } else { i++; } } if (found) { return ((String) input.get(i)); } else { return (null); } } }