001package co.codewizards.cloudstore.core.util;
002
003import java.util.ArrayList;
004import java.util.Collections;
005import java.util.List;
006
007public final class StringUtil {
008
009        private StringUtil() { }
010
011        public static List<Integer> getIndexesOf(String string, char c) {
012                ArrayList<Integer> indexes = new ArrayList<Integer>();
013                for (int index = 0; index < string.length(); ++index) {
014                        if (string.charAt(index) == c)
015                                indexes.add(index);
016                }
017                indexes.trimToSize();
018                return Collections.unmodifiableList(indexes);
019        }
020
021        public static boolean isEmpty(String string) {
022                return string == null || string.isEmpty();
023        }
024}