VBScript - DFWstangs Forums
 
LinkBack Thread Tools Display Modes
post #1 of 4 (permalink) Old 04-27-2003, 04:34 PM Thread Starter
 
Join Date: Mar 2003
Posts: 1,394
VBScript

how do i rezise a string
xtremcoder is offline  
Sponsored Links
Advertisement
 
post #2 of 4 (permalink) Old 04-28-2003, 02:04 AM Thread Starter
 
Join Date: Mar 2003
Posts: 1,394
fixed the problem, didnt resize the string though. however, i ran into another problem. is there a way i can search a string for a specific character?

for example, given the string "0923-1093"

can i check to see if that string contains the "-" character?
xtremcoder is offline  
post #3 of 4 (permalink) Old 04-28-2003, 09:30 AM
almost ready to race
 
FlowJack's Avatar
 
Join Date: Dec 2001
Location: Denton
Posts: 2,915
FUNCTION: InStr( )

--------------------------------------------------------------------------------
InStr(Start, String, Substring, Compare)
The InStr function returns the numeric position of the first occurrence of a specified substring within a specified string when starting from the beginning (left end) of the string.

An output of zero indicates no match.


The first argument is optional.

Start

The optional Start argument is the numeric position, counted from the left, which defines where to start the search for the substring. The search proceeds from the left to the right.


There are two mandatory arguments.

String

The String argument is the string in which you will search.


Substring

The Substring argument is the substring you are searching for.

Code:
InStr("ABCDE ABCDE", "C")

Output:
3

Code:
InStr(4, "ABCDE ABCDE", "C")

Output:
9

So in your specific example:

Code:
InStr("0923-1093", "-")

Output:
1

So if the output is > 0 then there is a dash in the string.

Hope that helps.

Last edited by FlowJack; 04-28-2003 at 09:33 AM.
FlowJack is offline  
 
post #4 of 4 (permalink) Old 04-28-2003, 10:52 AM
Bite Me!!!
 
I Stang U's Avatar
 
Join Date: Jul 2000
Location: A new Beast in Town!!
Posts: 2,457
an example

strPlead = "Please try to do what you can do"

pos = InStr(strPlead, "do")
If pos > 0 Then
Response.Write "Found first occurrence of string at position " & pos
Else
Response.Write "String not found"
End If
I Stang U is offline  
Sponsored Links
Advertisement
 
Reply

Bookmarks

Quick Reply
Message:
Options

Register Now



In order to be able to post messages on the DFWstangs Forums forums, you must first register.
Please enter your desired user name, your email address and other required details in the form below.

User Name:
Password
Please enter a password for your user account. Note that passwords are case-sensitive.

Password:


Confirm Password:
Email Address
Please enter a valid email address for yourself.

Email Address:
OR

Log-in










Thread Tools
Show Printable Version Show Printable Version
Email this Page Email this Page
Display Modes
Linear Mode Linear Mode



Posting Rules  
You may post new threads
You may 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 On
Trackbacks are On
Pingbacks are On
Refbacks are On

 
For the best viewing experience please update your browser to Google Chrome