Please ensure Javascript is enabled for purposes of website accessibility
Powered by Zoomin Software. For more details please contactZoomin

Edge HMI

StrSetElement

  • Last UpdatedOct 29, 2026
  • 1 minute read

StrSetElement sets the value of a specified element in a string source that contains a series of elements separated by a delimiter character.

Function

Group

Execution

String Exp.

Windows

Windows Embedded

IoT View

Thin Clients

Mobile Access

StrSetElement

String

Synchronous

No

Supported

Supported

Supported

Supported

Supported

Syntax

StrSetElement(strSource, strDelimiter, numElementNumber, strValue)

strSource

The source string.

strDelimiter

Char used as delimiter between the elements in strSource.

numElementNumber

Number of the element which will be returned by the function. The first element has the number 1. The second element has the number 2, and so forth.

strValue

The new value to be written at the specified element number. If there is an existing value, it will be overwritten by the new value.

Return value

If this function is successfully executed, it returns the updated string.

Examples

Start a new string of elements by concatenating the source string and the new value (returns TEXT|abcd):

StrSetElement("TEXT","|",2,"abcd")

Insert the new value into an empty element (returns TEXT|abcd|efgh|):

StrSetElement("TEXT|abcd||","|",3,"efgh")

Overwrite an existing value with the new value (returns TEXT|abcd|5678|ijkl):

StrSetElement("TEXT|abcd|efgh|ijkl","|",3,"5678")

In This Topic
Related Links