473,320 Members | 1,900 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

How Do I Find How Many Occurrences of ";" there are in a value?

Hello,

I am working on an asp page.. I would like to find out how many semi-colons
exist in a request variable. I thought I could use something like INSTR,
but, that just tells me WHERE the first occurrence is. Is there another way
to find out HOW MANY occurrences there are within an entire variable?

thanks,

Chip
Jul 22 '05 #1
3 1211
few ways.
- Split will give you the Count
- loop through each char (0-string length) and count.
- RegEx might have a way

--
Curt Christianson
Site & Scripts: http://www.Darkfalz.com
Blog: http://blog.Darkfalz.com
"MSUTech" <MS*****@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hello,

I am working on an asp page.. I would like to find out how many
semi-colons
exist in a request variable. I thought I could use something like INSTR,
but, that just tells me WHERE the first occurrence is. Is there another
way
to find out HOW MANY occurrences there are within an entire variable?

thanks,

Chip

Jul 22 '05 #2
"MSUTech" <MS*****@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
Hello,

I am working on an asp page.. I would like to find out how many semi-colons exist in a request variable. I thought I could use something like INSTR,
but, that just tells me WHERE the first occurrence is. Is there another way to find out HOW MANY occurrences there are within an entire variable?

thanks,

Chip


UBound(Split(your_string,";"))
Jul 22 '05 #3
"MSUTech" <MS*****@discussions.microsoft.com> wrote in message
news:30**********************************@microsof t.com...
.. . .
I would like to find out how many semi-colons exist in a request variable.


Just to be different ...

sVar = Request.QueryString( "Var" )
iLen = Len( sVar ) - Len( Replace( sVar, ";", "" ) )

HTH,
Phill W.
Jul 22 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Martin Magnusson | last post by:
I'm trying to "html-ise" some text, where an empty line should be interpreted as a paragraph break. I thought that $text = str_replace("\n\n", "</p><p>", $text); would work, but that doesn't...
3
by: Paul Janssen | last post by:
Hello! Can anyone help me out with the following situation: (a) a single query with 550 id's in the IN-clause resulting into 800+ seconds; (b) 550 queries with a single id in the IN-clause...
3
by: Rudy Ray Moore | last post by:
Hi guys, I often use the "Find" (aka CTRL-F) tool in "Visual Studio .net 2003 7.1 c++". I noticed that that dialog box does not go away when I perform a search (it stays on the screen). This...
2
by: Lenonardo | last post by:
Hi. I'm writing a VB.Net application to update multiple Excel Worksheets. I'm using late binding (i.e. all variables are objects + use createobject) I develop the application on an XP...
2
by: Ori :) | last post by:
I am writing an application to retrieve appointments from Outlook, I have the appointment items sorted by "Start" field and now I want to find the first record which's "Start" value is later than...
3
by: OJ | last post by:
Hi, I have added code to run on a button click event which adds usercontrols to an asp:Panel control held in a contentplaceholder defined by the masterpage. for (int x = 0; x <...
2
by: syvman | last post by:
Hi... I am working on a simple program (in VB.net) that will grab the values of elements out of an XML file that are tagged as "databasePath"... My program works, but I am getting too many...
4
bugboy
by: bugboy | last post by:
I'm inserting a new word into table 'w' and a definition into table 'c' which are linked in table 's' which is the relation table for the many to many relationship between 'w' and 'c'. I've been...
5
by: lsllcm | last post by:
Hi All, I have one question about many "or" operation make system choose incorrect index There is one table TT ( C1 VARCHAR(15) NOT NULL, C2 VARCHAR(15) NOT NULL, C3 VARCHAR(15) NOT NULL,...
5
by: accesstruggle | last post by:
Hello, I am having trouble with my database in Access. The problem lies in my report. I have created a report based off a query. The query contains all values that I'll need for my report- some will...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.