Raised This Month: $32 Target: $400
 8% 

Solved AMXX Need some help


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
D4rkSiD3Rs
Senior 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.

Last edited by D4rkSiD3Rs; 10-13-2018 at 17:54.
D4rkSiD3Rs is offline
instinctpt1
Senior Member
Join Date: Dec 2016
Location: Chandigarh, 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;

instinctpt1 is offline
Reply



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 01:47.


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