VBcoders Browse New Submit Contact Sign In

No account? Register free

Forgot password?

CReplaceString

PowerElite  (1 Submission)   String Manipulation   Visual Basic 3.0   Intermediate   Wed 3rd February 2021

CReplaceString is a function that I decided to code when I was bored. Had no idea what to code so I decided to code an advanced ReplaceString function. The concept is simple, it will replace a specified text in the string with something else.

Inputs
Public Function CReplaceString(ToFind As String, ReplaceWith As String, ToSearch As String, CaseSensitive As Boolean) As String

Assumes
All explinations are in the function, but here is the usage: Say you have a string, lets say UR_String and within that string you have the word or phrase, "replace_Me", and you want to replace that with "im_replaced". This is all you need to do UR_String = CReplaceString("replace_Me", "im_replaced", UR_String, True) The case sensitive is the advanced section of this. A normal replace string function would not have this. Could come in handy :)

Returns
The fixed string the replaced text.

Side Effects
None.

Rate CReplaceString (3(3 Vote))
CReplaceString.bas

CReplaceString Comments

No comments yet — be the first to post one!

Post a Comment

0/1000 characters