Foxtable(狐表)用户栏目专家坐堂 → 请教甜大师


  共有3740人关注过本帖树形打印复制链接

主题:请教甜大师

帅哥哟,离线,有人找我吗?
lsy
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:5246 积分:33163 威望:0 精华:8 注册:2013/1/17 21:28:00
  发帖心情 Post By:2014/7/15 16:57:00 [显示全部帖子]

供参考:

 

'Insert,按指定间隔插入指定长度的字符串:
Dim str As String = "好人32326777e288啦828a88bc6d78901234567890"
InputValue(str,"","请输入原字符串")
Dim s As String
InputValue(s,"","请输入插入字符串")
Dim Int As Integer = 1
InputValue(Int,"","请输入插入间隔长度")
If Int = 0 Then
    Return "除数不能为零"
End If
If str.Length Mod Int = 0 Then
    For i As Integer = Int To (str.Length \ Int) * (s.Length + Int) - s.Length - 1 Step s.Length + Int
        str = str.Insert(i,s)
    Next
Else
    For i As Integer = Int To (str.Length \ Int) * (s.Length + Int) - s.Length Step s.Length + Int
        str = str.Insert(i,s)
    Next
End If
str = str.Replace("空"," ")
Output.Show(str)


 回到顶部