From 165e118bc60c8c3dbb6c942776eae5af481933c4 Mon Sep 17 00:00:00 2001 From: TKB Studios <69647028+tkbstudios@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:26:32 +0100 Subject: [PATCH] Update textutils.lua --- .../computercraft/lua/rom/apis/textutils.lua | 31 ------------------- 1 file changed, 31 deletions(-) diff --git a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/textutils.lua b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/textutils.lua index 811d6b87e..c32b619ea 100644 --- a/projects/core/src/main/resources/data/computercraft/lua/rom/apis/textutils.lua +++ b/projects/core/src/main/resources/data/computercraft/lua/rom/apis/textutils.lua @@ -940,37 +940,6 @@ function urlEncode(str) return str end ---- Splits a string in a table. --- --- @tparam string inputstr The string to split. --- @tparam string sep The separator to split the string at --- @tparam nu --- @treturn table A table containing the splitted strings. --- @usage args = textutils.splitString("arg1 arg2", " ") --- @since edit this if it goes live (I hope it does) -function split(inputstr, sep, split_count) - expect(1, inputstr, "string") - expect(2, sep, "string", "nil") - expect(3, split_count, "number", "nil") - if sep == nil then - sep = "%s" - end - if split_count == nil then - split_count = -1 - end - local splitted_table = {} - local splitted_amount = 0 - for str in string.gmatch(inputstr, "([^" .. sep .. "]+)") do - if splitted_amount == split_count then - break - else - table.insert(splitted_table, str) - splitted_amount = splitted_amount + 1 - end - end - return splitted_table -end - local tEmpty = {} --- Provides a list of possible completions for a partial Lua expression.