C
C#4mo ago
Eve.

✅ help. i'm trying to make the last letter the first letter and vice versa

No description
106 Replies
Pobiega
Pobiega4mo ago
so if I type hello it would produce oellh?
Eve.
Eve.4mo ago
no it just produces hello
Eve.
Eve.4mo ago
No description
Eve.
Eve.4mo ago
it should produce this yes
Pobiega
Pobiega4mo ago
right so lets break it down we need to be able to get the first and the last character, and "the middle" then we just combine them do you know how to get the first character?
Eve.
Eve.4mo ago
did i not get it by doing word[0]
Pobiega
Pobiega4mo ago
yep! what about the last?
Eve.
Eve.4mo ago
i used the for loop
Pobiega
Pobiega4mo ago
that seems silly, doesnt it?
Eve.
Eve.4mo ago
i tried to google it
Pobiega
Pobiega4mo ago
we only need the last - why would we just a loop
Eve.
Eve.4mo ago
would it be word[word.length] idk
Pobiega
Pobiega4mo ago
yeah that works there is a better way to do the same thing thou word[^1] the ^ means "start from the end"
Eve.
Eve.4mo ago
No description
Eve.
Eve.4mo ago
do i not need to convert it to an array
Want results from more Discord servers?
Add your server