Message 1 of 3
Replacing specific characters of a string
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I have a string variable in format: [Name]_xxx_[Something else]
And another string variable called size : "999"
I want to replace the "xxx" with the size variable, but i can't get it to work.
I tried the following:
Dim oVar2 As String = GoExcel.CellValue(oExcel, "Blad1", "D" & oSubCellCount)
'Gives output: "EUA_xxx_A"
Dim oVarSize As String = GoExcel.CellValue(oExcel, "Blad1", "B" & oCellCount)
'Gives output: "025"
Replace(oVar2, "xxx", oVarSize)
Msgbox(oVar2)
'Still gives output "EUA_xxx_A" and not the desired "EUA_025_A"
i also tried without succes:
oVar2.replace("xxx", oVarSize)
The solution is probabably pretty simple, but an explanation of what i do wrong is appreciated.