FIND YOUR NEXT FEW LINES

Results for “Java”

Small, practical examples. Search by task or narrow things down below.

257 snippets foundClear filters
JavaText validation & formatting

Extract successive regex matches

Java: Use a Matcher loop to find all unsigned integer tokens in Java text.

Java✓ Tested
JavaText validation & formatting

Extract text between known positions

Java: Java substring uses a start-inclusive, end-exclusive range of UTF-16 indices.

Java✓ Tested
JavaScriptText handling & Unicode

Extract text by start and end positions

JavaScript: String slice uses an inclusive start and exclusive end measured in UTF-16 code units.

JavaScript✓ Tested
JavaScriptText handling & Unicode

Extract the text after the last delimiter

JavaScript: Use lastIndexOf when earlier occurrences should remain part of the prefix.

JavaScript✓ Tested
JavaCollections

Filter even numbers

Use a Java stream to collect only even values.

Java✓ Tested
JavaScriptArrays

Filter even numbers

Create a JavaScript array containing only even values.

JavaScript✓ Tested
JavaScriptObject behavior & collections

Find members absent from another set

JavaScript: Negate a membership test to calculate the set difference.

JavaScript✓ Tested
JavaQueues & collection operations

Find set members missing from another set

Java: Use removeAll on a copy to calculate a set difference.

Java✓ Tested
JavaScriptObject behavior & collections

Find shared members of two sets

JavaScript: Filter one set through the other set’s membership test.

JavaScript✓ Tested
JavaQueues & collection operations

Find shared set members

Java: Copy a set before retainAll when the original must remain unchanged.

Java✓ Tested
JavaScriptUTC date operations

Find the final day of a month

JavaScript: Day zero of the following UTC month selects the previous month’s final day.

JavaScript✓ Tested
JavaScriptArray traversal & selection

Find the first matching array item

JavaScript: find returns undefined when no item satisfies the predicate.

JavaScript✓ Tested