beautypg.com

Replace (searchstring, substring, replacestring), String or var, String,string var – Campbell Scientific CR9000X Measurement and Control System User Manual

Page 403: Right (searchstring, numchars), Rtrim (sourcestring)

background image

Section 11. String Functions

Replace (SearchString, SubString, ReplaceString)

The Replace function is used to search a string for a substring, and replace that
substring with a different string.

Syntax
String = Replace ( SearchString, SubString, ReplaceString )

Parameter
& Data Type

Enter

REPLACE PARAMETERS

SearchString
String or Var

The SearchString parameter is the string that will be parsed by this
instruction.

SubString
String,String Var

The SubString parameter is the portion of the string in the original string that
will be replaced.

ReplaceString

String,String Var

The ReplaceString parameter is the string that should be used to replace the
SubString.

Right (SearchString, NumChars)

The Right function returns a substring that is a defined number of characters
from the right side of the original string.

Syntax
String = Right( SearchString, NumChars )

Parameter
& Data Type

Enter

RIGHT PARAMETERS

String
String or Var

The string from which the Sub-string will be retrieved..

NumChars
Variable or
constant

The NumChars parameter is used to specify the number of characters from
the right side of the string to return.

.

RTrim (SourceString)

The RTrim function returns a copy of a string with no leading spaces.

Syntax
Variable = RTrim( SourceString )

Remarks
The SourceString parameter is the string that should be stripped of trailing
spaces.

To trim leading spaces only, use LTrim. To trim both leading and trailing
spaces, use Trim.

11-7