Closed frankcollins3 closed 1 year ago
the real problem is that I've reversed the whole array. this (algo?) expression calls for reversing each word. here's the code that's causing the not-precise-enough reversing of characters
[9:15pm]
code:
output: [9:21pm]
looping over split array and creating callback to reverse each word:
[9:37pm]
👍 GOTTIT!
code:
agreed.
[9:40pm]
microsoft's example: [9:47pm]
attempting to do: reverse each word in a string algorithm
error:
proposed approach: 👍 saw this below tip after getting this code to display as pictured above in the terminal. follow it; keep headbumping wall Important
This is a particularly difficult challenge. You will need to combine many of the concepts you learned in this exercise, including the use of the Split(), ToCharArray(), Array.Reverse(), and String.Join(). You'll also need to create multiple arrays, and at least one iteration statement.
possible improvements: once the iteration over split words became the go-to... a callback function that reversed words made this easier. also: realizing each word has to be it's own array even after looping. this is a nested loop but cb made it make more sense [updated improvement @ 9:40pm]
all the way below is microsoft's example. their example highlights that I didn't "make multiple arrays" to solve this, though that expectation is pictured right below this text within the "important" tip message. my provided example leverages every method they mentioned, though. [9:50pm]