remove dashes 
Author Message
 remove dashes

What function would I use if I want to remove all the dashes from this

string = "555-555-6454"

Thanks

Kris



Sun, 22 Sep 2002 03:00:00 GMT  
 remove dashes
create a function that accepts a string (to have dashes removed) and a
variable of char( what has to be removed)

function loops thru string char by char and appends to a new string only if
it doesn't match the char to remove

function returns the new string



Quote:
> What function would I use if I want to remove all the dashes from this

> string = "555-555-6454"

> Thanks

> Kris



Sun, 22 Sep 2002 03:00:00 GMT  
 remove dashes
create a function that loops through the string and appends to a new string
if not a "-". the function returns the new string

ypu can set up the function to use a variable that is the char you want
removed



Quote:
> What function would I use if I want to remove all the dashes from this

> string = "555-555-6454"

> Thanks

> Kris



Sun, 22 Sep 2002 03:00:00 GMT  
 remove dashes
create a function that accepts a string to be reformatted and a variable for
the char to be removed.
th function loops thru the string char by char and appends each char to the
new string if not the variable char.
the function returns the new string



Quote:
> What function would I use if I want to remove all the dashes from this

> string = "555-555-6454"

> Thanks

> Kris



Sun, 22 Sep 2002 03:00:00 GMT  
 remove dashes
Kristoffer,

In VB6 you can use the Replace function,

strWithDashes = "555-555-6454"
strWithoutDashes = Replace(strWithDashes, "-" "")

--
Regards

Carsten Thomsen
MVP VB
MCSE/VB Programmer & Analyst

PLEASE post ALL replies to the newsgroup(s) so we can all benefit from the
discussion!



Quote:
> What function would I use if I want to remove all the dashes from this

> string = "555-555-6454"

> Thanks

> Kris



Mon, 23 Sep 2002 03:00:00 GMT  
 remove dashes
In VB6 Look up Replace in Help

strphone = "555-555-555"

strtmp = Replace(strphone, "-", " ")  
'syntax: Replace(source, char to find, char to replace with)

returns strtmp = "555 555 555"


Quote:
> What function would I use if I want to remove all the dashes from this

> string = "555-555-6454"

> Thanks

> Kris



Mon, 23 Sep 2002 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. remove dashes from text field

2. Removing Dashes

3. Function to remove dashes from a string

4. Single quote and dash act strangely in string comparison

5. How do I put dashes in SS#

6. Insert em-dash with VBA?

7. inserting an em dash via code

8. dashed line turns into un-removable solid line

9. VB.Net - ADSI property name with dashes

10. insert a dash in social security number

11. MaskEdBox ---- Zip Code Dash

12. MaskEdBox: Need to eliminate dash from Zip Code

 

 
Powered by phpBB® Forum Software