We would like to build a community for Small Basic programmers of any age who like to code. Everyone from total beginner to guru is welcome. Click here to register and share your programming journey!


Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Challenge 3 - Text reversal
#1
Write a program to reverse the order of characters in a string.
Reply
#2
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
[-] The following 1 user Likes jrmrhrb00's post:
  • litdev
Reply
#3
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)
[-] The following 1 user Likes WhTurner's post:
  • litdev
Reply
#4
Ok I want like this challenge every week or alternate day
ZS
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)