IDataFunctions::CleanString

The CleanString method processes a string, stripping out white spaces, modifying the case of the string, and validating that the length of the string falls within a given range. If successful, CleanString returns the processed string.

Syntax

HRESULT CleanString(
VARIANT vtInput,// in
VARIANT vtMinLen,// in
VARIANT vtMaxLen,// in
VARIANT vtStripWhite,// in
VARIANT vtStripReturn, // in
VARIANT vtCase,// in
VARIANT vtLocale,// in
VARIANT *pvarOutput// out
);

Parameters

vtInput
A BSTR VARIANT that contains the string to process.
vtMinLen
A long (VT_I4) VARIANT that specifies the minimum length of the string. If this VARIANT is empty, CleanString initializes it to a default value of zero (0).
vtMaxLen
A long (VT_I4) VARIANT that specifies the minimum length of the string. If this VARIANT is empty, CleanString initializes it to a default value of zero (0).
vtStripWhite
A long (VT_I4) VARIANT that indicates whether to strip white spaces from the string. By default, this value is one (1), in which case the white spaces are stripped.
vtStripReturn
A long (VT_I4) VARIANT that indicates whether to strip the carriage returns from the string. By default, this value is one (1), in which case the white spaces are stripped.
vtCase
A long (VT_I4) VARIANT that indicates whether to convert the string to uppercase. By default, this value is zero (0), in which case the string is not converted to upper case.
vtLocale
A long (VT_I4) VARIANT that designates the locale to use to perform the conversion. If this VARIANT is empty, then the locale specified by a previous call to put_Locale is used to perform the conversion.
pvarOutput
If CleanString is successful, pvarOutput contains the address of a BSTR VARIANT that has been initialized to contain the processed string; otherwise, NULL.

Include

<commerce.h>

Return Values

Value Description
S_OK The method succeeded, and pvarOutput contains the processed string.
E_OUTOFMEMORY CleanString could not allocate the memory for pvarOutput.


© 1997-1998 Microsoft Corporation. All rights reserved.