Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / counting Chars inside a String

Author
Message
haliop_New
User Banned
Posted: 27th Jun 2015 03:32 Edited at: 27th Jun 2015 03:34
EDIT ::::: USING TIER 1 ::::::

im trying to figure something out here...
i want to be able to "count" all the spaces in one string
so i tried to use

CountStringTokens(string," ")
but it will only count a space char where there is one space char and then any other char but if there are 2 space chars together it will count them as one....

any way to achive this ? im breaking my head over it...
there is probably a very simple way to do it but i cant figure it out...
so please if you have anything you want to share... please do.

thank you for your time.
haliop.
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 27th Jun 2015 11:00 Edited at: 27th Jun 2015 11:01
Something like this:



Using AppGameKit V2 Tier 1
Scraggle
Moderator
20
Years of Service
User Offline
Joined: 10th Jul 2003
Location: Yorkshire
Posted: 27th Jun 2015 11:47 Edited at: 27th Jun 2015 11:50
I have a CountString() function in my Additional String Functions that I provided to the community.
It allows you to count any string within a string not just a single character.

AGK V2 user - Tier 1 (mostly)
haliop_New
User Banned
Posted: 27th Jun 2015 14:46
WOW thank you both! very appreciated.

Login to post a reply

Server time is: 2024-03-29 12:58:12
Your offset time is: 2024-03-29 12:58:12