Tutorial

Getting Started with Macros

Macro Editor

User Interface

Menus and Toolbar

Editing Macros

Macro Debugging

How To

Using variables

Finding and modifying objects

Creating new page content

Asking for user input

Storing persistent data

Using binary data

Sorting objects

Macro menus

Bulleted and numbered lists

Sample Macros

Concepts

Expressions

Objects

Properties

Variables

Data Types

Arrays

Functions

Literals

Operators

Comments

Last updated on: September 02, 2024
Also available as a single HTML file

Onetastic Macro Documentation > Functions > String Functions > String_Trim

String_Trim

Removes whitespace (or other characters) from the beginning and/or end of a string and returns the resulting string.

Syntax

String String_Trim(
	String string, 
	String characters, 
	String trimDirection)

Parameters

String string
String to be trimmed.
String characters
Set of characters to be trimmed. If left empty, following characters will be removed: Space (ASCII 32), Tab (ASCII 9), New Line (ASCII 10), Carriage Return (ASCII 13), Vertical Tab (ASCII 11).
String trimDirection
Direction of the trim. Can be "left", "right" or "both".

Examples

$string = " The quick brown fox " String_Trim($string, "", "left") // "The quick brown fox\r\n" String_Trim($string, "", "right") // " \tThe quick brown fox" String_Trim($string, "", "both") // "The quick brown fox" String_Trim("The quick brown fox", "Txohef ", "both") // "quick brown"

Reference

Statements

Hierarchy Objects

Page Objects

Other Objects

Functions

Array Functions

Color Functions

Data Store Functions

Date/Time Functions

Dialog Box Functions

Macro Execution Functions

Macro Menu Functions

Object Functions

Special Functions

String Functions

Window Functions