Строка '321 @ 322 @ 323 @ 324 @ 325'. здесь количество цифр в каждом номере равно 3, но не ограничено 3, это может быть любое число. здесь 5 чисел в строке, но это может быть что угодно. задача состоит в том, чтобы получить 321,322,323,324,325 и сохранить их в таблице, чтобы над ними можно было выполнить любую операцию.
Я пробовал несколько строковых функций, таких как c = c: gsub ('% W', ''), чтобы исключить эти не алфавитно-цифровыесимволы, но ничего не помогло.
function encrypter()--FUNCTION 14
c=' '
print('Please enter your message!')
local message=io.read()
lengthOfString=string.len(message)--Inbuit function to get length of a string.
newLine()
print('Please enter your key. Remember this key, otherwise your message wont be decrypted')
newLine()
key=io.read()
key=tonumber(key)
largeSpace()
print("Encrypted message is")
for s=1,lengthOfString do
--print(encryptionFormula(string.byte(message,s),key))
--inbuilt function for converting character of a string to it's respective ASCII value. First place gets character or variable having string whereas second place gets position of that character in the given string.
b=encryptionFormula(string.byte(message,s),key)
c=c..tostring(b)..'@'
--print(c)
b=0
end
print(c)
largeSpace()
print("Now share this message along with the key to the receiver. Don't share your key with anyone, if you don't want your message to be read.")
end