r/lua • u/freakinultrahell • Mar 24 '25
WHAT AM I DOING WRONG
Oh yeah the text in the second one is
firstname = "bruhD" lastname = "vro"
fullname = firstname .." ".. lastname uppercase = string.upper(fullname) subtext = string.sub(fullname, 1, 4) findletter = string.find(fullname, "D") print("the letter D is at the number: ".. findletter)
[Help i cant freaking do this, and i already tried without print()]
14
Upvotes


30
u/Shadow123_654 Mar 24 '25
Ok so firstly: please share your code properly formatted, accordingly to rule 5. The more hoops someone has to go through to help you (reading badly formatted/screenshoted code), the less chances someone will help you 🫤
Running your program, I get 5 printed on the screen, so it seems to be working just fine? Remember that array indexing starts at one in Lua.Â
7
u/[deleted] Mar 25 '25
What a nice name. Nice to meet you bruhD vro
11
u/st3f-ping Mar 24 '25
What results are you getting? And how does this differ from what you expect?
5
u/lamiexde Mar 24 '25
1
u/Vamosity-Cosmic Mar 25 '25
if this is for a class, u prolly forgot to localize the variables