← all categories
Strings (no loops)
-
tripleString 1.15 🌶️
Write a method that takes one String parameter, s, and returns a new String containing s …
-
initials 1.15 🌶️
Write a method that takes two String parameters, first and last (a person's first and las…
-
lastLetterTwice 1.15 🌶️
Write a method that takes one String parameter, s, and returns a String containing just t…
-
middleCharacter 1.15 🌶️
Write a method that takes one String parameter, s, and returns the single character in th…
-
removeCharAt 1.15 🌶️🌶️
Write a method that takes a String parameter s and an int parameter index, and returns a …
-
firstWord 1.15 🌶️
Write a method that takes one String parameter, s, and returns everything in s up to (but…
-
textAfter 1.15 🌶️🌶️
Write a method that takes two String parameters, text and target, and returns everything …
-
insideParentheses 1.15 🌶️🌶️
Write a method that takes one String parameter, text, and returns the part of text betwee…
-
swapEnds 1.15 🌶️🌶️
Write a method that takes one String parameter, s, and returns a new String with the firs…
-
withNeighbors 1.15 🌶️🌶️
Write a method that takes two String parameters, text and target. Find where target first…
-
removeFirst 1.15 🌶️🌶️
Write a method that takes two String parameters, text and target, and returns text with t…
-
replaceOnce 1.15 🌶️🌶️
Write a method that takes three String parameters, text, target and replacement, and retu…
-
insertAfter 1.15 🌶️🌶️
Write a method that takes three String parameters, text, target and addition, and returns…
-
lastNameFirst 1.15 🌶️🌶️
Write a method that takes one String parameter, fullName, made of a first name, exactly o…
-
secondOccurrenceIndex 1.15 🌶️🌶️🌶️
Write a method that takes two String parameters, text and target, and returns the index i…
-
renameExtension 1.15 🌶️🌶️
Write a method that takes two String parameters: filename, a file name with exactly one d…
-
reformatDate 1.15 🌶️🌶️🌶️
A date is written as month/day/year, with slashes and no leading zeros, like "3/14/2024" …
-
comesBefore 1.15 🌶️
Write a method that takes two String parameters, a and b, and returns true if a comes bef…
-
maskAccountNumber 1.15 🌶️🌶️🌶️
Write a method that takes one String parameter, number, and returns it with every charact…
-
extractDomain 1.15 🌶️🌶️🌶️
Write a method that takes one String parameter, url, and returns just its domain. A url a…
-
Fix trimEnds 1.15 🌶️🌶️
The method below is supposed to return `s` without its first and last character, so `"(he…
-
Fix host 1.15 🌶️
The method below is supposed to return the part of an email address AFTER the `@`, so `"a…
-
Fix isAdmin 1.15 🌶️🌶️
The method below is supposed to return true if `user` is exactly `"root"` and false other…
-
Fix comesFirst 1.15 🌶️🌶️
The method below is supposed to return true if the String `a` comes before the String `b`…
-
isVowel 1.15 🌶️
Write a method `isVowel` that returns `true` if the one-letter lowercase String `letter` …
-
containsText 2.2 🌶️
Write a method that takes two String parameters, text and target, and returns true if tar…
-
beginsWith 2.5 🌶️🌶️
Write a method that takes two String parameters, text and prefix, and returns true if tex…
-
countCapitals 2.10 🌶️
Write a method `countCapitals` that takes a String `s` and returns how many of its charac…
-
longestRun 2.10 🌶️🌶️
A **run** is a stretch of the same character repeated in a row. Write a method `longestRu…
-
hasDuplicateLetter 2.11 🌶️🌶️
Write a method `hasDuplicateLetter` that takes a String `s` and returns `true` if some ch…