#Paper Posted November 2, 2010 Share Posted November 2, 2010 I'm working to new mapratings system, i want to get how many is rated one map string.find( name, "l+") How i can get how many results there is for this string.find? ty all! Link to comment
dzek (varez) Posted November 2, 2010 Share Posted November 2, 2010 explain it better as i dont understand it.. you cant to count character instances in string? like on every vote you are adding "+" to string, then you have like "+++++++" and want to count it? this is the way i understood it. Link to comment
#Paper Posted November 2, 2010 Author Share Posted November 2, 2010 explain it better as i dont understand it..you cant to count character instances in string? like on every vote you are adding "+" to string, then you have like "+++++++" and want to count it? this is the way i understood it. For example: In a txt file I have the string with "hello" how can I do to have as many are there these strings? Link to comment
dzek (varez) Posted November 2, 2010 Share Posted November 2, 2010 uhm, this is a bit weird way, but the simpliest i think function countWord(text, word) local changed, count = string.gsub(text, word, function() end) return count end it will work only with simple words like : "hello". it will fail if use with chars like [ ] ( ) . * { } % Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now