1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-06 01:10:23 +00:00
QB64-PE/internal/help/_TRIM$__1111$.txt
Roland Heyder 6912727753 Update help files
Help file snapshot as of 07/31/2022.
2022-07-31 23:57:56 +02:00

43 lines
1.2 KiB
Plaintext

{{QBDLDATE:07-31-2022}}
{{QBDLTIME:23:40:44}}
{{DISPLAYTITLE:_TRIM$}}
The [[_TRIM$]] function removes both leading and trailing space characters from a [[STRING]] value.
{{PageSyntax}}
:{{Parameter|return$}} = [[_TRIM$]]({{Parameter|text$}})
{{PageDescription}}
* Shorthand to using [[LTRIM$]]([[RTRIM$]]("text"))
* {{Parameter|text$}} is the [[STRING]] value to trim.
* If {{Parameter|text$}} contains no leading or trailing space characters, it is returned unchanged.
* Convert fixed length [[STRING]] values by using a different {{parameter|return$}} variable.
{{PageExamples}}
''Example: Demonstrating how _TRIM$(text$) can replace LTRIM$(RTRIM$(text$)):
{{CodeStart}}
text$ = {{Cl|SPACE$}}(10) + "some text" + {{Cl|SPACE$}}(10)
{{Cl|PRINT}} "[" + text$ + "]"
{{Cl|PRINT}} "[" + {{Cl|RTRIM$}}(text$) + "]"
{{Cl|PRINT}} "[" + {{Cl|LTRIM$}}(text$) + "]"
{{Cl|PRINT}} "[" + {{Cl|LTRIM$}}({{Cl|RTRIM$}}(text$)) + "]"
{{Cl|PRINT}} "[" + {{Cl|_TRIM$}}(text$) + "]"
{{CodeEnd}}
{{OutputStart}}[ some text ]
[ some text]
[some text ]
[some text]
[some text]
{{OutputEnd}}
{{PageSeeAlso}}
* [[RTRIM$]], [[LTRIM$]]
{{PageNavigation}}
[[Category:Latest]]