Deleting characthers in a string 
Author Message
 Deleting characthers in a string

Is it possible to delete a specific characther in i string?

e.g
remove all "x" in this string "hdgxjsfhx"




Wed, 22 Sep 1999 03:00:00 GMT  
 Deleting characthers in a string



Quote:
>Is it possible to delete a specific characther in i string?

>e.g
>remove all "x" in this string "hdgxjsfhx"



    Dim sStr As String
    Dim iPos As Integer

    sStr = "hdgxjsfhx"
    iPos = InStr(sStr, "x")
    While iPos
        sStr = Left$(sStr, iPos - 1) & Mid$(sStr, iPos + 1)
        iPos = InStr(sStr, "x")
    Wend

Lee Weiner

"The difference between a wise man and a fool
 is that the fool never learns from his mistakes."



Thu, 23 Sep 1999 04:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Characther wrap in a label

2. SQL delete query deletes but does not delete

3. CODE: How to Select Entire String (Sentence) and Delete

4. CODE: Select text string in cell and delete?

5. VBA to select all text bewteen 2 different search strings and delete

6. deleting the string (I=A) using wildcards

7. UTTER NEWBIE!!! - Deleting Strings from a file

8. Delete bytes from a string

9. delete string from text file

10. Delete string

11. Delete string

12. excel vba - help finding designated text within string and deleting selected range's row

 

 
Powered by phpBB® Forum Software