> For the complete documentation index, see [llms.txt](https://malwaresourcecode.com/home/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://malwaresourcecode.com/home/markdown/stringlength.md).

# StringLength

```
SIZE_T StringLengthW(LPCWSTR String)
{
    LPCWSTR String2;

    for (String2 = String; *String2; ++String2);

    return (String2 - String);
}

INT StringLengthW2(LPCWSTR String)
{
    INT Length = 0;

    while (String && String[Length])
        ++Length;

    return Length;
}

SIZE_T StringLengthW3(LPCWSTR String)
{
    LPCWSTR p = String;

    while (*p && *(p + 1) && *(p + 2) && *(p + 3))
        p += 4;

    while (*p)
        p++;

    return (p - String);
}
```
