strPoke Function

Overwrites part of a string with another string.


str strPoke(
    str _text1,
    str _text2,
    int _position)

Parameter

Description

_text1

The original string.

_text2

The string with which to replace part of the original string.

_position

The position of the original string at which to begin replacing the characters.

The new string.

The new string can be longer than the original string. However, if the value of the _position parameter is greater than the length of the string, the original string is returned without replacements.

  • strPoke("12345678","AAA",3); //Returns the string "12AAA678".

  • strPoke("abcde","4567",4); //Returns the string "abc4567".

  • strPoke("abcde", "4567", "10"); //Returns the string "abcde".

Community Additions

ADD
Show: