SFL: String handling functions

Top  Previous  Next

The string handling functions are used when you need to manipulate strings in a program. A number of functions exists, and they are each explained individually on the following pages.

 

String template

The string template functions are helpful when handling large strings that are used multiple times but must be slightly different every time, such as strings that contain sensor data to send to an external device. See strTemplateCreate for more details.

 


strFormat

Formats a string.


strGetValues

Extracts numerical values from a string.


strGetStrings

Extracts string values from a string.


strToInt

Converts a string to a number (INT).


hexToInt

Converts a hex string to a number (INT).


strToDint

Converts a string to a number (DINT).


hexToDint

Converts a hex string to a number (DINT).


strToSint

Converts a string to a number (SINT).


hexToSint

Converts a hex string to a number (SINT).


strCompare

Compare two strings.


strConcat

Concatenate two strings.


strLeft

Extracts the left part of a string.


strRight

Extracts the right part of a string.


strMid

Extracts part of a string.


strLen

Finds the length (number of characters) of a string.


strLookup

Find a string in a list of strings.


strFind

Checks if a string is contained within another string.


strToken

Extracts a string from a delimited string.


strRemoveSpaces

Removes leading/trailing spaces in a string.


sintToStr

Converts a number (SINT) to a string.


sintToHex

Converts a number (SINT) to a hex string.


intToStr

Converts a number (INT) to a string.


intToHex

Converts a number (INT) to a hex string.


dintToStr

Converts a number (DINT) to a string.


dintToHex

Converts a number (DINT) to a hex string.


strToMemory

Copies contents of a string to memory.


strFromMemory

Copies contents of memory to a string.


strEncode64

Encodes a string with base 64.


strDecode64

Decodes a base 64 encoded string.


strMemoryUsage

Get information about memory usage of dynamic strings.


strTemplateCreate

Create a string template to perform fast replacement of sub-strings.


strTemplateFree

Release the string template,


strTemplateVarInfo

Get information about the variables found in the string template.


strTemplateSetVar

Update the value of a variable in the string template.


strTemplateGenerateString

Generate a string from the string template.

 

 

 

For floating-point string conversion, please refer to the Floating-Point Math section.