string.match
Örnek
local toMatch = "this is a sample text"
print( string.match( toMatch, "sample" ) )
-- desenler çalışır
print( string.match( toMatch, "^[a-z]" ) )
print( string.match( toMatch, "^this" ) )
print( string.match( toMatch, "^..is" ) )
print( string.match( toMatch, "text$" ) )
-- tüm string
print( string.match( toMatch, "^.*$" ) )
-- çoklu dönüş değerleri
print( string.match( toMatch, "(this) is a (%w+)" ) )
-- nil
print( string.match( toMatch, "this$" ) )
print( string.match( toMatch, "nil" ) )
Çıktı:
sample
t
this
this
text
this is a sample text
this sample
nil
nil
Tüm sunucular · GmodTR Launcher · Rehber · GMod Wiki · GmodTR nedir? · Sunucu ekle · Discord