以文本方式查看主题

-  Foxtable(狐表)  (http://foxtable.com/bbs/index.asp)
--  专家坐堂  (http://foxtable.com/bbs/list.asp?boardid=2)
----  [求助]如何更改字符串中某个字符的值?  (http://foxtable.com/bbs/dispbbs.asp?boardid=2&id=87370)

--  作者:hzcaqjf
--  发布时间:2016/7/9 14:03:00
--  [求助]如何更改字符串中某个字符的值?
Dim s As String = "01000000000011000000"
If s.Chars(5) = "0" Then
    s.Chars(5) = "1"
End If
红色代码应怎样写?

--  作者:Hyphen
--  发布时间:2016/7/9 15:15:00
--  
Dim s As String = "01000000000011000000"
If s.Chars(5) = "0" Then
    s = s.Remove(5,1)
    s = s.Insert(5,"1")
End If

--  作者:hzcaqjf
--  发布时间:2016/7/9 15:42:00
--  
问题已解决,谢谢!