We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
This library provides easy-to-read string manipulation utils. Some examples:
new StringFormat("/{user}-home/{year}/{month}/{day}") .parse(path, (user, year, month, day) -> ...);
String input = "I have [k1:v1] and [k2:v2] etc."; // Returns Map.of("k1", "v1", "k2", "v2") Map<String, String> keyValues = new StringFormat("[{key}:{value}]") .scanAndCollectFrom(input, Collectors::toMap);
// replace file extension name Substring.last('.').toEnd().replaceFrom(filename, ".yaml");
// remove the scheme from a url Substring.upToIncluding(first("://")).removeFrom(url);
// Parse the datetime string read from a file List<String> lines = readLinesFromTestFile(...); StringFormat lineFormat = new StringFormat("{time}, {event_id}, {event_type}"); var results = lines.stream() .map(line -> lineFormat.parseOrThrow(line, (time, id, type) -> { ZonedDateTime dateTime = DateTimeFormats.parseZonedDateTime(time); ... })) .collect(toList());
See javadoc for details.
Mug is a general purpose library. Omitted, but other useful utils include BiStream for streaming pairs, Optionals, String Templating, simplified structured concurrency etc.