Be concise.
Be useful.
All contributions dictatorially edited by webmasters to match personal tastes.
Please do not paste any copyright violating material.
Please try to avoid dependencies to third-party libraries and frameworks.
import java.util.ArrayList;
import java.util.List;
import static java.lang.Character.isWhitespace;
import static java.lang.Integer.parseInt;
List<Integer> items = new ArrayList<>();
int x, y, n = s.length(), i;
for (x = 0; x != n; ++x)
if (!isWhitespace(s.charAt(x))) {
for (y = x + 1; y != n; ++y)
if (isWhitespace(s.charAt(y)))
break;
i = parseInt(s.substring(x, y));
items.add(i);
x = y - 1;
}
var
tmp: array of string;
items: array of integer;
...
tmp := s.split(whitespace, TStringsplitOptions.ExcludeEmpty);
SetLength(items, Length(tmp));
for i := Low(tmp) to High(tmp) do items[i] := StrToInt(tmp[i]);
items = [int(x) for x in s.split()]
items = [*map(int, s.split())]
items = s.split.map(&:to_i)
let items = s
.split_whitespace()
.map(|x| x.parse::<i32>().unwrap())
.collect::<Vec<i32>>();
let items = s
.split_whitespace()
.map(|x| x.parse::<i32>().unwrap())
.collect::<Vec<i32>>();