• Earn real money by being active: Hello Guest, earn real money by simply being active on the forum — post quality content, get reactions, and help the community. Once you reach the minimum credit amount, you’ll be able to withdraw your balance directly. Learn how it works.

Visual Basic Return a String Less a particular Character

Status
Not open for further replies.

Kaway

Banned
User
Joined
Aug 7, 2014
Messages
720
Reputation
0
Reaction score
5,766
Points
243
Credits
0
‎10 Years of Service‎
15%
Please note, if you want to make a deal with this user, that it is blocked.
[HIDE-THANKS]You can use this function to find a specific character in a given string variable, and then return that string sans the character for which you searched. Example provided in the source.

Code:
> Function Searchstring(StringToSearch As String, StringToFind As String) As String 
Dim Char, Newword As String 
Dim intStartingFrom, intCount As Long 

intCount = Len(StringToSearch) + 1 
Do Until intStartingFrom >= intCount 
  intStartingFrom = intStartingFrom + 1 
  Char = Mid$(StringToSearch, intStartingFrom, 1) 
If Char = StringToFind Then 
Else 
  Newword = Newword & Char 
End If 
Loop 
  Searchstring = Newword 
End Function
[/HIDE-THANKS]
 
Status
Not open for further replies.
Back
Top