Str.del

From OpenEUO
Revision as of 16:07, 11 November 2010 by Ximan (Talk | contribs) (Created page with "== Calling Pattern == Call local s2 = sl.str.del(s1,n,m) Args s1 is a string n,m are numbers Results s2 is a string == Usage Example == local s = sl.str local r = s.del('...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

Calling Pattern

Call

local s2 = sl.str.del(s1,n,m)

Args

s1 is a string
n,m are numbers

Results

s2 is a string

Usage Example

local s = sl.str
local r = s.del('One really long string.',5,7)
print(r)
--> One long string.

Description

Deletes a subsection of string s1 and returns the altered string. Section removed begins at character n and runs for m characters.

Upon Error

Del fails silently. If del receives incorrect parameter types, then '' (an empty string) is returned.

See Also