替换 VBA 字符串中的 caracter
**** Hidden Message ***** 是的,使用Instr()找到它,在找到的位置添加它 我使用<strong>替换<br>和<pre>Replace(expression, find, replace[, start[, count[, compare]]])Public Sub Main()
Dim strNewString As String
strNewString = Replace("d:\\Program files\\Folder 1\\Sub folder 2", "\\", "\", 1)
MsgBox strNewString
End Sub
使用替换
Dim Path as String
Dim NewPath As String
Path = "d:\Program files\Folder 1\Sub folder 2"
NewPath = Replace (Path, "\", "\\")
新路径将等于“d:\\Program files\\Folder 1\\Sub Folder 2”
dangit..Matt击败了我…
哇哦!
呜呜呜!!
我需要学习更快地打字...
我知道有一种更简单的方法,我只是不记得我的头顶上的REPLACE
哇哦!
我需要学习更快地打字...
不,他只是比你上蜡和上蜡都多。 谢谢你们。这将是有帮助的。 C:\test\\\Stuff.dwg
公共函数 RemoveRepetitiveBackSlashes( StrText, Optional AlternativeString as String) as String
Dim StrFind as String
Dim StrDoulblure as String
if Len (Alternative) > 0 那么
StrFind = AlternativeString
else
StrFind = “\”
end if
StrDoublure = StrFind & StrFind
Do While( Len(RemoveRepetitiveSlashes )Len(StrText)
RemoveRepetitiveSlashes = StrText
StrText = Replace(StrText, “\”, “\\”)
loop
结束功能
页:
[1]