Raised This Month: $170 Target: $400
 42% 

AMXX Need some help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D4rkSiD3Rs
Member
Join Date: Jan 2018
Location: Morocco
Old 05-13-2018 , 20:23   AMXX Need some help
Reply With Quote #1

Hello,

How can i calculate the number of digits in a string whatever if it contains letters or digits ?
I tried to use strlen and isdigit but isdigit works only if the string contains only digits.
D4rkSiD3Rs is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Rajasthan, India
Old 05-13-2018 , 22:35   Re: AMXX Need some help
Reply With Quote #2

PHP Code:

CountNumbers
( const String[] )
{
    new 
Count;
    new 
Len strlen( String );
    
    for ( new 
Leni++ )
    {
        if ( 
isdigitString] ) )  { Count++; }
    }
    
    return 
Count;

__________________
CSIndia The only Indian Scripters Community
instinctpt1 is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 04:57.


Powered by vBulletin®
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Theme made by Freecode