sign in | join about | help | sitemap
Connecting Tech Pros Worldwide
Joey Martin's Avatar

How many times does a character appear


Question posted by: Joey Martin (Guest) on December 9th, 2005 05:05 PM

I've done this before but cannot remember how.

I have a field (FIELDNAME) in a sql2k environment.

I just need to know how many times an "_" appears in that field.

Pretty simple, but I cannot figure it out right now.

Thanks!


*** Sent via Developersdex http://www.developersdex.com ***
1 Answer Posted
Evertjan.'s Avatar
Guest - n/a Posts
#2: Re: How many times does a character appear

Joey Martin wrote on 09 dec 2005 in
microsoft.public.inetserver.asp.general:
[color=blue]
> I've done this before but cannot remember how.
>
> I have a field (FIELDNAME) in a sql2k environment.
>
> I just need to know how many times an "_" appears in that field.
>
> Pretty simple, but I cannot figure it out right now.[/color]


ASP-js:

t = 'qwe_rtyq_uerty'
n = t.replace(/[^_]/g,'').length


--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

 
Not the answer you were looking for? Post your question . . .
196,946 members ready to help you find a solution.
Join Bytes.com

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 196,946 network members.
Post your question now . . .
It's fast and it's free

Popular Articles

Top Community Contributors