473,666 Members | 2,237 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1216
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*****@discus sions.microsoft .com> wrote in message
news:30******** *************** ***********@mic rosoft.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*****@discus sions.microsoft .com> wrote in message
news:30******** *************** ***********@mic rosoft.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(yo ur_string,";"))
Jul 22 '05 #3
"MSUTech" <MS*****@discus sions.microsoft .com> wrote in message
news:30******** *************** ***********@mic rosoft.com...
.. . .
I would like to find out how many semi-colons exist in a request variable.


Just to be different ...

sVar = Request.QuerySt ring( "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
4749
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 find anything to replace in my strings, and $text = str_replace("\n", "</p><p>", $text); gives me too many paragraphs, of course. As an example of what I want, this message should be divided into three
3
2251
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 resulting into overall time of <60 seconds; The table consists of 950.000 records, and the resultset consists of 205.000 records.
3
1494
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 is different from the behavior of VS6. I find this frusterating because a mouse click is required to close the window (I cannot ALT-TAB back to the find window to press ESC).
2
7648
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 machine with Excel 2002 (version 10.0) installed - and the code works fine. I then test the code on a laptop running Excel 2000 (version 9.0) and it
2
10089
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 now (future appointment The relevant piece of my current code Dim oCalendar As Outlook.MAPIFolder = oNS.GetDefaultFolder(Outlook.OlDefaultFolders.olFolderCalendar Dim oItems As Outlook.Items = oCalendar.Item oItems.Sort("Start"...
3
3500
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 < (Master.PartyCtrl.Adults ); x++) { ASP.usercontrols_passenger_ascx passenger = new ASP.usercontrols_passenger_ascx(); this.pnlAdults.Controls.Add(passenger);
2
10633
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 results. I need to limit the scope of the program to only include the string value from the element that has a parent of "numberone", and not both "numberone" and "numbertwo". I don't know if "numberone" is a node, or what the correct term for it is...
4
5104
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 passed 2 variables from a form; $word and $def and i'm inserting them ok but i'm having trouble getting and passing on their ID's in order to insert them into the relation table 's' I've checked every query and they all work individually, so i...
5
2111
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, C4 VARCHAR(15) NOT NULL
5
2874
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 be directly on the report in text boxes, etc and others will be needed for calculations only and so are not directly on the report. My problem is when I'm writing the code for my text box "TriagePercent" which should, based on the AuditNum (pk)...
0
8440
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8355
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8550
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8638
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7381
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6191
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4193
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2769
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1769
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.