LCStream の Trim メソッド

このメソッドは、テキストストリームの末尾のスペースを削除します。ストリームがテキスト形式でない場合、またはストリームに LCSTREAM_NO_TRIM フラグが設定されている場合は、このメソッドは何も実行しません。

定義位置

LCStream

構文

lcStream . Trim

Option Public
Uselsx "*lsxlc" 
Sub Initialize
  Dim msg As New LCStream
  msg.Text = "   this has space at the start and the end     "
  msg.Trim ' trim trailing spaces (not leading ones)
  Print "The msg is *" & msg.Text & "*".
End Sub

出力例

The msg is *   this has space at the start and the end*.