String Manipulations
19 JavaScript string manipulations challenges, each with test cases you can run in the browser.
- makeOutWord — Easy. Given an 'out' string length 4, such as '<<>>', and a word, return a new string where the word is in the middle of the out string, e.g. '<<w
- firstHalf — Easy. Given a string, return the first half of the string. If the string length is odd, return the first half rounded down.
- reverseString — Easy. Given a string, return a new string with the reversed order of characters.
- findLongestWord — Easy. Return the length of the longest word in the provided sentence.
- titleCase — Easy. Return the provided string with the first letter of each word capitalized. Make sure the rest of the word is in lower case.
- repeatStringNumTimes — Easy. Repeat a given string `str` for `num` times. Return an empty string if `num` is not a positive number.
- truncateString — Easy. Truncate a string if it is longer than the given maximum string length. Return the truncated string with a '...' ending.
- getInitials — Easy. Given a full name, return the initials.
- containsVowels — Easy. Given a string, return true if it contains any vowels, otherwise false.
- maxChar — Easy. Given a string, return the character that is most commonly used in the string.
- isPalindrome — Medium. Given a string, return true if the string is a palindrome. A palindrome is a word, phrase, number, or other sequence of characters that read
- spinalCase — Medium. Convert a string to spinal case. Spinal case is all-lowercase-words-joined-by-dashes.
- pigLatin — Medium. Translate the provided string to pig latin. Pig Latin takes the first consonant (or consonant cluster) of an English word, moves it to the e
- searchAndReplace — Medium. Perform a search and replace on the sentence using the arguments provided and return the new sentence. Preserve the case of the first charac
- missingLetters — Medium. Find the missing letter in the passed letter range and return it. If all letters are present in the range, return undefined.
- convertHTML — Medium. Convert the characters &, <, >, " (double quote), and ' (apostrophe), in a string to their corresponding HTML entities.
- binaryAgent — Medium. Return an English translated sentence of the passed binary string.
- isAnagram — Medium. Given two strings, check if they are anagrams of each other. An anagram is a word or phrase formed by rearranging the letters of a different
- permAlone — Hard. Return the number of total permutations of the provided string that don't have repeated consecutive letters. Assume that all characters in t