Dear Perehama, PieterP, SteveMann!
Thank you for these great answers! I think, with these answers, I slowly understand what UKHeliBob has explained (the lambda function is a little over the top for a newbie like me, but it helps! I got nose bleeding after reading it... )
I have to stay in the scope of a function if I don't want to use a lambda function for using an object (function) or better I avoid Strings and do char arrays.
In the book, I'm reading right now the author came up with the String object and as a newbie, I thought it was a good idea to use it. But for me, simpler is better at this moment.