Login | Register   
LinkedIn
Google+
Twitter
RSS Feed
Download our iPhone app
TODAY'S HEADLINES  |   ARTICLE ARCHIVE  |   FORUMS  |   TIP BANK
Browse DevX
Sign up for e-mail newsletters from DevX


Tip of the Day
Language: Visual Basic
Expertise: Intermediate
Jul 19, 2001

Remove a Character From a String


Use the following code:
 
Public Function RemoveChar(ByVal str As String, ByVal strChar 
As String) As String 
'   Function:   RemoveChar 
' 
'   Desc:       Extracting requested character from given string. 
Return value is changed string 
' 
'   Parm:       str     - string that has to be changed 
'               strChar - character that supose to be extracted 
' 
    
    While (InStr(1, str, strChar) <> 0) 
        str = Left(str, InStr(1, str, strChar) - 1) & Mid(str, 
InStr(1, str, strChar) + 1) 
    Wend 
    RemoveChar = str 
End Function
Milos Dulic
 
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

Sitemap
Thanks for your registration, follow us on our social networks to keep up-to-date