Navigation:  thinBasic Modules > Core > String handling >

STRREVERSE$

Previous pageReturn to chapter overviewNext page

 

Description

 

Reverse the contents of a string expression.

 

Syntax

 

s = STRREVERSE$(sMain)

 

Returns

 

String

 

Parameters

 

Name

Type

Optional

Meaning

sMain

String

No

The string to reverse

 

Remarks

 

Restrictions

 

See also

 

String Handling,

 

Examples

 

Thanks to Abraxas for the following script example

Dim sMain      As String VALUE "HELLO WORLD"

Dim sNew       As String VALUE "TO THE "

Dim StringExpression As String VALUE sMain

Dim sDEL       As String

Dim sINS       As String

Dim sREV       As String

Dim sSTR       As String

Dim Start      As DWORD VALUE 4

Dim count      As DWORD VALUE 7

Dim position   As DWORD VALUE 7

Dim sMsg       As String

 

sDEL = STRDELETE$ (StringExpression , start, count)

sINS = STRINSERT$ (sMain, sNew, position)

sREV = STRREVERSE$(sMain)

 

sMsg += "sMain = " & sMain & $CRLF

sMsg += "sNew = " & sNew & $CRLF

sMsg += "StringExpression = " & StringExpression  & $CRLF & $CRLF

sMsg += "Start = " & Start & $CRLF

sMsg += "Count = " & count & $CRLF

sMsg += "Position = " & position & $CRLF & $CRLF

 

sMsg += "STRDELETE$(string_expression, start, count) = " & sDEL & $CRLF & $CRLF

sMsg += "STRINSERT$(sMain, sNew, position) = " & sINS & $CRLF & $CRLF

sMsg += "STRREVERSE$(sMain) = " & sREV & $CRLF & $CRLF

 

MSGBOX 0, sMsg

 

 

 

 

 

© 2004-2008 thinBasic. All rights reserved. Version 1.7.0.0 Web Site: http://www.thinbasic.com