Share via


DataFunctions.CleanString Method (PIA)

Use this method to process a string, based on the default or specified locale. The string processing can include stripping out leading and trailing white spaces, modifying string case, and validating that the length of the string falls within a given range.

Definition

[Visual Basic .NET]

Imports Microsoft.CommerceServer.Interop
…
Public Function CleanString(vtInput As Object,
 Optional vtMinLen As Object,
 Optional vtMaxLen As Object,
 Optional vtStripWhite As Object,
 Optional vtStripReturn As Object,
 Optional vtCase As Object,
 Optional vtLocale As Object) As Object

[C#]

using Microsoft.CommerceServer.Interop;
…
public object CleanString(objectvtInput,
 objectvtMinLen,
 objectvtMaxLen,
 objectvtStripWhite,
 objectvtStripReturn,
 objectvtCase,
 objectvtLocale);

Parameters

[Visual Basic .NET]

  • vtInput
    An Object that contains the text of the string to process.
  • vtMinLen
    An Object that contains the minimum length against which the length of the input string will be validated. The default value for this parameter is zero (0).
  • vtMaxLen
    An Object that contains the maximum length against which the length of the input string will be validated. The default value for this parameter is no limit.
  • vtStripWhite
    An Object that contains the Boolean value that indicates whether leading and trailing white spaces should be stripped from the input string. The default value is True.
  • vtStripReturn
    An Object that contains the Boolean value that indicates whether the carriage returns contained anywhere in the input string should be stripped. The default value is True.
  • vtCase
    An Object that specifies any conversions to the case of the input string. The default value for this parameter is zero (0), which results in no modification to the case of the input string. If this parameter is set to one (1), the input string is converted to uppercase. If this parameter is set to two (2), the input string is converted to lowercase.
  • vtLocale
    An Object that specifies the locale to use when processing the input string. If this parameter is not specified, the value of the Locale property of the DataFunctions object is used.

[C#]

  • vtInput
    An object that contains the text of the string to process.
  • vtMinLen
    An object that contains the minimum length against which the length of the input string will be validated. The default value for this parameter is zero (0).
  • vtMaxLen
    An object that contains the maximum length against which the length of the input string will be validated. The default value for this parameter is no limit.
  • vtStripWhite
    An object that contains a Boolean value that indicates whether leading and trailing white spaces should be stripped from the input string. The default value is true.
  • vtStripReturn
    An object that contains the Boolean value that indicates whether the carriage returns contained anywhere in the input string should be stripped. The default value is true.
  • vtCase
    An object that specifies any conversions to the case of the input string. The default value for this parameter is zero (0), which results in no modification to the case of the input string. If this parameter is set to one (1), the input string is converted to uppercase. If this parameter is set to two (2), the input string is converted to lowercase.
  • vtLocale
    An object that specifies the locale to use when processing the input string. If you want the value of the Locale property of the DataFunctions object to be used, pass Type.Missing for this parameter.

Return Values

[Visual Basic .NET] If this method completes successfully, it returns a string Object that contains the processed string; otherwise, Null is returned.

[C#] This method returns an object that contains the processed string.

Exceptions

This method may throw one of many mapped exceptions or an exception of type COMException. See Standard COM Errors for additional details.

Example

[Visual Basic .NET]

DataFunctions df = New DataFunctions()
df.Locale = 1033
Dim Result As Object
Dim strData As Object
strData = " Microsoft Press   "
Result = df.CleanString(strData, 1, 20, True, True, 1)
Response.Write(Result)
' "MICROSOFT PRESS" will be written to the page

[C#]

No example available.

Requirements

Namespace: Microsoft.CommerceServer.Interop

Platforms: Windows 2000, Windows Server 2003

Assembly: mscsasphelplib (in mscsasphelplib.dll)

See Also

DataFunctions Class

DataFunctions.Locale

Page.RequestString

Copyright © 2005 Microsoft Corporation.
All rights reserved.