哪位有置换算法函数?,这是有一个移位算法函数
hsg77 2003-01-24 01:52:24 '///移位算法
Public Function MoveChar(SData As String, IsbeforeDirection As Boolean, Movestep As Integer)
If IsbeforeDirection Then '前移Movestep步
For i = 1 To Movestep
SData = Right(SData, Len(SData) - 1) & Left(SData, 1)
Next i
Else '后移Movestep步
For i = 1 To Movestep
SData = Right(SData, 1) & Left(SData, Len(SData) - 1)
Next i
End If
MoveChar = SData
End Function
' MsgBox MoveChar("123456", True, 3) --->456123
' MsgBox MoveChar("happy new year", True, 3) --->py new yearhap