Video Coming Soon...
46: tr
WARNING: This is from the Go course but I'm rewriting the code and the description to fit C. If you want to attempt it go ahead. The challenge is the same, just no examples yet.
The tr command is another very useful tool that "translates" one set of characters to another set. It reads the input, looks at each character, and changes any that match the input set to the output set.
Most of the documentation for tr talks about "array1 and array1" which are just the two sets of characters you give tr as command line options.
The Challenge
You are required to implement the following options to tr:
-c-- Compliment ofarray1, which means inverse, so every character not inarray1.-d-- Delete chars that matcharray1.-s-- Squeeze the characters found inarray2, which means to remove duplicates.-t-- Truncatearray1toarray2length.
You can find the documentation for tr here:
Register for From Impostor to Programmer
Register today for the course and get the all currently available videos and lessons, plus all future modules for no extra charge.