Function Main As String
' Show trimming and case conversions

' THE EXAMPLE ILLUSTRATES THE USE OF:
'   LTrim
'   RTrim
'   Trim
'   UCase
'   LCase



Dim s,s0,say,dcr As String,v,vv As Double, i,k As Integer
Const title="SHOW STRING TRIMMING AND CASE CONVERSIONS"
Const s0="  An Example Text    "

  k=MBB_OK + MBI_INFORMATION
  dcr=Chr(13)+Chr(13)

  'Note the use of Chr to insert carriage return symbols (decimal code 13)
  say="Note that "+dcr

  'Show source string
  i=MessageBox(say+"original string = "+dcr+"'"+s0+"'", title, k)

  'Apply LTrim
  s=LTrim(s0)
  i=MessageBox(say+"LTrim("+"'"+s0+"'"+")= "+dcr+"'"+s+"'", title, k)

  'Apply RTrim
  s=RTrim(s0)
  i=MessageBox(say+"RTrim("+"'"+s0+"'"+")= "+dcr+"'"+s+"'", title, k)

  'Apply Trim
  s=Trim(s0)
  i=MessageBox(say+"Trim("+"'"+s0+"'"+")= "+dcr+"'"+s+"'", title, k)

  'Apply UCase
  s=UCase(s0)
  i=MessageBox(say+"UCase("+"'"+s0+"'"+")= "+dcr+"'"+s+"'", title, k)

  'Apply LCase
  s=LCase(s0)
  i=MessageBox(say+"LCase("+"'"+s0+"'"+")= "+dcr+"'"+s+"'", title, k)



  Main="Demo completed"
End Function