Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

WindowsTrimStringEnd function

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

Syntax


HRESULT WINAPI WindowsTrimStringEnd(
  _In_  HSTRING string,
  _In_  HSTRING trimString,
  _Out_ HSTRING *newString
);

Parameters

string [in]

Type: HSTRING

The string to be trimmed.

trimString [in]

Type: HSTRING

The characters to remove from string.

newString [out]

Type: HSTRING*

The string that remains after all occurrences of characters in the trimString parameter are removed from the end 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 codeDescription
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 WindowsTrimStringEnd function must be matched with a corresponding call to WindowsDeleteString.

Requirements

Minimum supported client

Windows 8 [desktop apps | UWP apps]

Minimum supported server

Windows Server 2012 [desktop apps | UWP apps]

Minimum supported phone

Windows Phone 8

Header

Winstring.h

See also

WindowsDeleteString

 

 

Show:
© 2017 Microsoft