Lua - Finding the index of substring and reversing string Code Example

The code for Finding the index of substring and reversing string

str = "Hello, world - the world is mine"

-- replacing strings
print(str.find(str,"world"))
reversedString = str.reverse(str)
print("The new string is",reversedString)

--[[
Output:
8	12
The new string is	enim si dlrow eht - dlrow ,olleH
--]]
Code by IncludeHelp, on August 25, 2022 23:03

Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.