No inbuilt functions
Hello, im a year 1 student so my knowledge is not that massive.
So i have this task for university where we have to do multiple steps without using inbuilt functions except length
so my question is, are there any ways to change from lowercase to uppercase without ToUpper, and how to split row1 user text in half and put row2 text in middle of row1.
Thanks in advance if anyone
9 Replies
The fun thing about
char
s is that they're numbers under the hoodAngius
REPL Result: Success
Result: char
Compile: 360.183ms | Execution: 24.469ms | React with ❌ to remove this embed.
An uppercase version of a letter has an ASCII value 32 lower than the lowercase
well we had to make user input then you type something random, and if the program sees lowercase it trasnforms that letter into uppercase, but
And this is how you can transform lowercase into uppercase without using
.ToUpper()
A string
is just a char[]
under the hood
Loop over the string, uppercase each char
Assemble the string back with new string(char[])
For the second part find the middle by deviding the length by two and then do a loop of some sort to achieve what you're trying to achieve
Yep
Loop over the outer string, when you hit the midpoint loop over the inner string, go back to the outer string