Just made this cool function, because i was sick of using like 40 replace( things
VB Code:
Option Explicit Dim StrRep() As String Dim i As Integer Dim EndStr As String Private Sub Form_Load() Call ReplaceStr("Hello there cat, its 4:32 PM", ":!!! cat!!!t!!!")''''PUT THE THINGS YOU WANT TO SPLIT BY INBETWEEN THE !!!!, OR ADD MORE WITH !!! End Sub Public Function ReplaceStr(BaseStr As String, StrToReplace As String) StrRep() = Split(StrToReplace, "!!!") For i = 0 To UBound(StrRep) If i = 0 Then EndStr = Replace(BaseStr, StrRep(i), vbNullString) Else EndStr = Replace(EndStr, StrRep(i), vbNullString) End If Next i MsgBox EndStr End Function
enjoy!![]()





Reply With Quote