String Week Challenge - Day 6

String Week Challenge - Day 6

Clearing the clutter away


3 min read

Hello, hello! We're almost there, almost a full week into the great month of October (aka Huntober)! Thank you so much for hanging in there and coming along on this wacky string journey with me.

⏰ Join in the Fun - It's not too Late

Welcome to String Week! We're working towards decoding a secret message by combining all our work for the week, please check out Days 1-5 before working on today's challenge.

⭐ String Week

This week our challenges all deal with Strings! As one of JavaScript's primitive data structures, Strings are critical to understand and manipulate. Feel free to use JavaScript's built-in String methods.

🏆 The Challenge - Day 6

This week we will be discovering hidden messages by manipulating a given string. Your solutions should account for any non-empty string. On Friday we'll combine our functions to decode a message.

Thanks for all your help yesterday, you guys are cool cats! Today's challenge will have you removing decoy characters from a string.

Write a function that, when given a non-empty string, and positive integer X, removes every Xth character from the string. Counting should begin from the first element in the string and should continue in that pattern until the end of the string.

For example:

// For the string below and 4
"Thies its H alltowe!en!? Th#is Tis GHalolowmeen$!"
// remove decoy strings
"This is Halloween! This is Halloween!"

// For the string below and 5
"The LBachyelor^ is ma tehrrib le tpelev!isioOn sh8ow."
// remove decoy strings and preach 🙌
"The Bachelor is a terrible television show."

🧩 Start Putting it Together

Tomorrow is day 7 of 7, and you'll be receiving a final function assignment as well as the task of putting all of your other functions from the week together in sequence.

If you like, you can get started on piecing together your functions today. Please remember that the functions must be performed on the provided string in order. If you do things out of order it will get messy very fast.

It is totally up to you how you want to organize your code. Some may choose to create a master decoding function that calls each helper function as needed, while others may prefer to chain the function calls separately. Up to you.

Note: Day 2 and Day 5 were side-projects, and their real purpose was to provide you with inputs for this final decoding. Day 2's key characters and Day 5's final count will be used as arguments for Day 3 and Day 6's functions, respectively.

Here's the encrypted string for the week, enjoy!

const encryptedMsg = "e!!Igv)t5lltBcvbdeDH3dVw!OOtI#Aa.ZMDu7WYpP^VVjDc4I50iv#ylhgmQfs"

Do any of you have any guesses about what the message could be? I think it'll stay unsolved until tomorrow, but who knows?

Wait, What's Huntober?

Leon Noel's 100Devs are spending October preparing for the job hunt. Anyone who has already broken into a tech career knows that the application and interview process can be grueling! The current cohort has progressed this year all the way from basic HTML files to hosted full-stack applications with authentication and databases.

This month they'll continue to build, but will also work on data structures & algorithms, networking and interview skills, and solving code challenges.