1
1
Fork 0
mirror of https://github.com/QB64-Phoenix-Edition/QB64pe.git synced 2024-07-04 04:50:22 +00:00
QB64-PE/internal/help/_TRIM$__1111$.txt
Roland Heyder aeb9c0668b Updates help files for use with new Wiki parser (2nd try)
Note: Many files were removed (not yet existing/empty pages). The parser will try to download them on demand and will auto-generate text for missing pages (eg. most _gl pages).
2022-05-21 00:18:31 +02:00

42 lines
1.2 KiB
Plaintext

{{QBDLDATE:05-20-2022}}
{{QBDLTIME:23:11:30}}
{{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}}