strnset

Syntax

string strnset(string str, int c, int n)

Arguments

str
The string to set
c
The character which the string is to be set to
n
The maximum number of characters in str to set

Return

A pointer to the new string.

Description

strnset sets at most n characters of string str to character c.

Example

int s = strcpy(&str0, "This is the message!");
s = strnset(s, 'X', 4);
Info("%s", s);

Also see

strset