首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > .NET > VB Dotnet >

怎样将字符串“AABBCCDDEE”变为“AA-BB-CC-DD-EE”,多谢啦

2012-03-06 
怎样将字符串“AABBCCDDEE”变为“AA-BB-CC-DD-EE”,谢谢啦!RT[解决办法]Dim str As String AABBCCDDEEFFGGH

怎样将字符串“AABBCCDDEE”变为“AA-BB-CC-DD-EE”,谢谢啦!
RT

[解决办法]
Dim str As String = "AABBCCDDEEFFGGHHIIJJKK "
Dim i As Int16, j As Int16
i = str.Length / 2 - 1
For j = 1 To i
str = str.Insert(j * 2 + j - 1, "- ")
Next
MsgBox(str)

热点排行