09-02-2024, 10:14 PM
Write a program to reverse the order of characters in a string.
Challenge 3 - Text reversal
|
09-02-2024, 10:14 PM
Write a program to reverse the order of characters in a string.
09-03-2024, 01:41 PM
string = "Hello, World!"
length = Text.GetLength(string) string2="" For x = length To 1 step -1 string2= text.Append(string2,text.GetSubText(string,x,1)) endfor TextWindow.WriteLine(string2) JR
09-03-2024, 01:49 PM
I had nearly the same:
string="Write a program to reverse the order of characters in a string" TextWindow.WriteLine(string) reverse="" length=Text.GetLength(string) For i=length To 1 Step -1 reverse=reverse+Text.GetSubText(string,i,1) EndFor TextWindow.WriteLine(reverse) |
« Next Oldest | Next Newest »
|