I have a string: abc!246!def
I need to replace the 246 with the ö character which is 246 on the ASCII table.
Is there is a way to search the string for the ! and then replace whatever number is in between then ! with what ascii character it is?
-----------------------------------------------------------------
"The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'."
- unknown
myStr = replace(myStr, "!" + cStr(numVal) + "!", Chr(numVal))
-----------------------------------------------------------------
"The difference between 'involvement' and 'commitment' is like an eggs-and-ham breakfast: the chicken was 'involved' - the pig was 'committed'."
- unknown
Dim Results As String
Dim ary() As String
Dim i As Integer
ary = Split(TheString, "!"
For i = 0 To UBound(ary)
If i <> 1 Then Results = Results & ary(i)
Next i
Or,
Dim Pos As Integer
Pos = InStr(TheString, "!"
If Pos Then TheString = Mid$(TheString, 1, Pos - 1) & Mid$(TheString, InStrRev(TheString, "!" + 1) [/b][/i][/u]*******************************************************
General remarks:
If this post contains any suggestions for the use or distribution of code, components or files of any sort, it is still your responsibility to assure that you have the proper license and distribution rights to do so!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.