/** * Splits {@code sequence} into string components and returns them as an immutable list. If you * want an {@link Iterable} which may be lazily evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }
/** * Splits {@code sequence} into string components and returns them as an immutable list. If you * want an {@link Iterable} which may be lazily evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }
/** * Splits {@code sequence} into string components and returns them as an immutable list. If you * want an {@link Iterable} which may be lazily evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }
/** * Splits {@code sequence} into string components and returns them as * an immutable list. If you want an {@link Iterable} which may be lazily * evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<String>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }
/** * Splits {@code sequence} into string components and returns them as an immutable list. If you * want an {@link Iterable} which may be lazily evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }
/** * Splits {@code sequence} into string components and returns them as an immutable list. If you * want an {@link Iterable} which may be lazily evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }
/** * Splits {@code sequence} into string components and returns them as * an immutable list. If you want an {@link Iterable} which may be lazily * evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<String>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }
/** * Splits {@code sequence} into string components and returns them as * an immutable list. If you want an {@link Iterable} which may be lazily * evaluated, use {@link #split(CharSequence)}. * * @param sequence the sequence of characters to split * @return an immutable list of the segments split from the parameter * @since 15.0 */ @CheckReturnValue @Beta public List<String> splitToList(CharSequence sequence) { checkNotNull(sequence); Iterator<String> iterator = splittingIterator(sequence); List<String> result = new ArrayList<String>(); while (iterator.hasNext()) { result.add(iterator.next()); } return Collections.unmodifiableList(result); }