WindowsTrimStringStart function (winstring.h)

Removes all leading occurrences of a specified set of characters from the source string.

Syntax

HRESULT WindowsTrimStringStart(
  HSTRING string,
  HSTRING trimString,
  HSTRING *newString
);

Parameters

string

Type: [in] HSTRING

The string to be trimmed.

trimString

Type: [in] HSTRING

The characters to remove from string.

newString

Type: [out] HSTRING*

The string that remains after all occurrences of characters in the trimString parameter are removed from the start of string, or NULL if trimString contains all of the characters in string.

Return value

Type: HRESULT

This function can return one of these values.

Return code Description
S_OK
The trimmed string was created successfully.
E_INVALIDARG
newString is NULL, or trimString is empty.
E_OUTOFMEMORY
Failed to allocate the trimmed string.

Remarks

Each call to the WindowsTrimStringStart function must be matched with a corresponding call to WindowsDeleteString

Requirements

Requirement Value
Minimum supported client Windows 8 [desktop apps | UWP apps]
Minimum supported server Windows Server 2012 [desktop apps | UWP apps]
Target Platform Windows
Header winstring.h

See also

WindowsDeleteString