Strings for Beginners

Reverse, count, capitalise, compress and validate text: the string skills every interview and project uses.

  1. Reverse a String Return the characters of a string in reverse order. Easy All 5 languages
  2. Count the Vowels Count how many vowels (a, e, i, o, u) a string contains, ignoring case. Easy All 5 languages
  3. Capitalize Each Word Make the first letter of every word upper case. Easy All 5 languages
  4. Longest Word in a Sentence Find the longest word in a sentence; if there's a tie, return the first one. Easy All 5 languages
  5. Run-Length Encoding Compress a string by replacing each run of the same character with the character and the run's length. Easy All 5 languages
  6. Is It a Pangram? Check whether a sentence uses every letter of the alphabet at least once. Easy All 5 languages
  7. Make an Acronym Build an acronym from the first letter of each word, in upper case. Easy All 5 languages
  8. Caesar Cipher Shift every letter forward in the alphabet by a fixed amount, wrapping from z back to a. Easy All 5 languages
  9. Reverse the Words Reverse the order of the words in a sentence. Easy All 5 languages
  10. First Unique Character Return the index of the first character that appears only once, or -1. Easy All 5 languages
  11. Roman Numerals to Integer Convert a Roman numeral such as MCMXCIV into an integer. Easy All 5 languages
  12. Longest Common Prefix Find the longest starting text that every word in a list shares. Easy All 5 languages
  13. Valid Username Check a username against simple rules: length, allowed characters and a starting letter. Easy All 5 languages

← All coding problems

Was this page helpful?