sorcery  Diff

Differences From Artifact [345c990ba7]:

  • File lib/str.lua — part of check-in [ea6e475e44] at 2020-10-19 09:52:11 on branch trunk — continue dev on celestial mechanics, add melding+division spells (resonance), refine itemclasses, add keypunch and punchcards, add paper pulp, add a shitload of visuals, add convenience scripts for working with the wiki, make the flamebolt spell actually useful instead of just a pretty lightshow, add essences, inferno crystal, and other goodies; iterate on wands, lots of shit i can't remember, various bugfixes (user: lexi, size: 2983) [annotate] [blame] [check-ins using]

To Artifact [94cda47230]:


12
13
14
15
16
17
18
19


20
21
22
23
24


25
26
27
28
29
30
31
return {
	capitalize = function(str)
		return string.upper(string.sub(str, 1,1)) .. string.sub(str, 2)
	end;

	beginswith = function(str,pfx)
		if #str < #pfx then return false end
		return string.sub(str,1,#pfx) == pfx


	end;

	endswith = function(str,sfx)
		if #str < #sfx then return false end
		return string.sub(str,#sfx) == sfx


	end;

	explode = function(str,delim,pat) -- this is messy as fuck but it works so im keeping it
		local i = 1
		local tbl = {}
		if pat == nil then pat = false end
		repeat







|
>
>




|
>
>







12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
return {
	capitalize = function(str)
		return string.upper(string.sub(str, 1,1)) .. string.sub(str, 2)
	end;

	beginswith = function(str,pfx)
		if #str < #pfx then return false end
		if string.sub(str,1,#pfx) == pfx then
			return true, string.sub(str,1 + #pfx)
		end
	end;

	endswith = function(str,sfx)
		if #str < #sfx then return false end
		if string.sub(str,#sfx) == sfx then
			return true, string.sub(str,1,#sfx)
		end
	end;

	explode = function(str,delim,pat) -- this is messy as fuck but it works so im keeping it
		local i = 1
		local tbl = {}
		if pat == nil then pat = false end
		repeat