3 trim, Trim – Metrohm viva 1.0 Manual User Manual
Page 75
■■■■■■■■■■■■■■■■■■■■■■
2 General program functions
viva 1.0
■■■■■■■■
63
The parameter can be indicated either directly as a number or as a variable
of the Number type. If the parameter does not correspond to the
expected type, it will automatically be converted to it. If a type conversion
is not possible or the length indicated here is greater than the length of
the subtext, then invalid will be returned.
Examples
SubText("Citric acid";8;4) = acid
SubText("Citric acid";8;5) = invalid, only 4 characters exist from posi-
tion 8 onwards
SubText('MV.ID2';1;3) = the first three characters of the identification 2
2.3.4.8.3
Trim
Dialog window: Formula editor
▶ Operators/Functions
Syntax
y = Trim(Text)
Returns the Text without spaces before and after.
y = Trim(Text; sample text)
Returns the Text without Sample text.
Parameters
Text
The parameter can be indicated either directly or as a variable of the Text,
Number or Date/Time type.
Sample text
The parameter can be indicated either directly or as a variable of the Text,
Number or Date/Time type. If the types of the two parameters do not
coincide, the type is converted from Sample text to the Text type.
NOTE
Entries of the Number type are always provided with a decimal place.
Example: Trim("12345";3) = 12345, as the 3 is converted to 3.0
before the operation and this is not included in the text.
Examples
Trim(" Citric acid ") = "Citric acid"
Trim("Citric acid";"acid") = Citric
Trim("Citric acid";"salt") = Citric acid