Update all new Tasks
This commit is contained in:
parent
00a190b0a6
commit
91df62d461
5697 changed files with 93386 additions and 804 deletions
13
Task/String-matching/Lua/string-matching.lua
Normal file
13
Task/String-matching/Lua/string-matching.lua
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
s1 = "string"
|
||||
s2 = "str"
|
||||
s3 = "ing"
|
||||
s4 = "xyz"
|
||||
|
||||
print( "s1 starts with s2: ", string.find( s1, s2 ) == 1 )
|
||||
print( "s1 starts with s3: ", string.find( s1, s3 ) == 1, "\n" )
|
||||
|
||||
print( "s1 contains s3: ", string.find( s1, s3 ) ~= nil )
|
||||
print( "s1 contains s3: ", string.find( s1, s4 ) ~= nil, "\n" )
|
||||
|
||||
print( "s1 ends with s2: ", select( 2, string.find( s1, s2 ) ) == string.len( s1 ) )
|
||||
print( "s1 ends with s3: ", select( 2, string.find( s1, s3 ) ) == string.len( s1 ) )
|
||||
Loading…
Add table
Add a link
Reference in a new issue