Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Why doesn't s:find(".") return nil?

Asked by 6 years ago

No matter what the string value of s is, s:find(".") will always return 1. Is there a reason for this? am I doing something wrong?

0
I did a bit of research; this might be why: http://wiki.roblox.com/index.php?title=String_pattern#Character_Classes It's a special character. >.< TheeDeathCaster 2368 — 6y

1 answer

Log in to vote
0
Answered by
cabbler 1942 Moderation Voter
6 years ago
Edited 6 years ago

string.find matches patterns by default. In patterns "." means "any character". To ignore patterns do string.find(str,'.',1,true)

Ad

Answer this question