string::SetBytes

Description

Set the content of this string from a vector of bytes

Syntax

BOOL SetBytes( vector<byte> & vb )

Parameters

vb
[input] vector of bytes to be put into this string

Return

Returns TRUE on success, otherwise return FALSE

Examples

EX1

void string_SetBytes_ex1()
{
        vector<byte> vTemp = {'A','B','C','D'};
        string str ="something to make it longer";
        BOOL bRet = str.SetBytes(vTemp);
        out_int("",bRet);//true
        out_str(str);//"ABCD"
}

Remark

See Also

vectorbase::SetBytes, string::GetBytes

header to Include

origin.h