#Paper Posted November 2, 2010 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! My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
dzek (varez) Posted November 2, 2010 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. Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
#Paper Posted November 2, 2010 Author 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? My skype: skiper964 I helped you? Help me! ^^ Help me bro! ^^
dzek (varez) Posted November 2, 2010 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 [ ] ( ) . * { } % Multi theft auto tools - replace cars and peds, move your map or compile your Lua files online! programista php rzeszów Need free webhosting for your small site? PM me. Need help with portforwarding? PM me. Do not PM me asking for help with scripting. Having problems with port forwarding? Send me pm, I can do whole thing for you using TeamViewer (already helped about 20 people, no worries)!
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