VBcoders Guest



Don't have an account yet? Register
 


Forgot Password?



Scrambles or descrambles a string according to the ROT13 standard.

by Ruben (1 Submission)
Category: String Manipulation
Compatability: Visual Basic 5.0
Difficulty: Unknown Difficulty
Originally Published: Tue 3rd October 2000
Date Added: Mon 8th February 2021
Rating: (1 Votes)

Scrambles or descrambles a string according to the ROT13 standard.

Rate Scrambles or descrambles a string according to the ROT13 standard.




Public Function Rot13(ByVal j As String) As String 
Dim c As Byte 
Dim t As String 
t = j 
For i = 1 To Len(j) 
t = Right(t, Len(j) - i + 1) 
c = Asc(t) 
If (c > 64) And (c < 78) Then 
Rot13 = Rot13 + Chr(c + 13) 
ElseIf (c > 77) And (c < 91) Then 
Rot13 = Rot13 + Chr(c - 13) 
ElseIf (c > 96) And (c < 110) Then 
Rot13 = Rot13 + Chr(c + 13) 
ElseIf (c > 109) And (c < 123) Then 
Rot13 = Rot13 + Chr(c - 13) 
Else 
Rot13 = Rot13 + Chr(c) 
End If 
Next i 
End Function 

'Example, Rot13("Ruben") will return "Ehora"
'and Rot13("Ehora") will return "Ruben".
'Could be used to scramble contents of created
'text file etc. that you want to be accessed by
'your created program only.

'Created by "Ruben" <[email protected]>


Download this snippet    Add to My Saved Code

Scrambles or descrambles a string according to the ROT13 standard. Comments

No comments have been posted about Scrambles or descrambles a string according to the ROT13 standard.. Why not be the first to post a comment about Scrambles or descrambles a string according to the ROT13 standard..

Post your comment

Subject:
Message:
0/1000 characters