about | help | code help+videos | done | prefs |
Write a function txtHelp(txt) that returns an expanded version of the string txt, which may contain texting abbreviations like "brb" and "lol." Your function should expand "brb" to "be right back", "lol" to "laugh out loud", "u" to "you", and "r" to "are". Notice that if an r appears in the middle of a word you should NOT expand it to "are". You may assume all abbreviations and their replacements are lowercase. txtHelp('lol, cat pictures are hilarious!') → 'laugh out loud, cat pictures are hilarious!' txtHelp('just saw a cat pic, brb, gotta check this out') → 'just saw a cat pic, be right back, gotta check this out' txtHelp('u r awesome') → 'you are awesome' ...Save, Compile, Run (ctrl-enter) |
Progress graphs:
Your progress graph for this problem
Random user progress graph for this problem
Random Epic Progress Graph
Copyright Nick Parlante 2017 - privacy