|
of_trim
|
|
Full name
|
pfc_n_cst_string.of_trim
|
Access
|
public
|
Extend of
|
string
|
Return value
|
string
|
Prototype
|
public function string of_trim(string,boolean,boolean)
|
Name
|
Datatype
|
ls_null
|
string
|
public function string of_trim (string as_source, boolean ab_remove_spaces, boolean ab_remove_nonprint);//////////////////////////////////////////////////////////////////////////////
//
// Function: of_Trim
//
// Access: public
//
// Arguments:
// as_source The string to be trimmed.
// ab_remove_spaces A boolean stating if spaces should be removed.
// ab_remove_nonprint A boolean stating if nonprint characters should be removed.
//
// Returns: string
// as_source with all desired characters removed from the left and
// right end of the string.
// If any argument's value is NULL, function returns NULL.
//
// Description: Removes desired characters from the left and right end of
// a string.
// The options depending on the parameters are:
// Remove spaces from the beginning and end of a string.
// Remove nonprintable characters from the beginning and
// end of a string.
// Remove spaces and nonprintable characters from the
// beginning and end of a string.
//////////////////////////////////////////////////////////////////////////////
//
// Revision History
//
// Version
// 5.0 Initial version
//
//////////////////////////////////////////////////////////////////////////////
//
// Copyright © 1996-1997 Sybase, Inc. and its subsidiaries. All rights reserved.
// Any distribution of the PowerBuilder Foundation Classes (PFC)
// source code by other than Sybase, Inc. and its subsidiaries is prohibited.
//
//////////////////////////////////////////////////////////////////////////////
//Check parameters
If IsNull(as_source) or IsNull(ab_remove_spaces) or IsNull(ab_remove_nonprint) Then
string ls_null
SetNull(ls_null)
Return ls_null
End If
If ab_remove_spaces and ab_remove_nonprint Then
// Remove spaces and nonprintable characters from the beginning and end
// of a string.
as_source = of_LeftTrim (as_source, ab_remove_spaces, ab_remove_nonprint)
as_source = of_RightTrim(as_source, ab_remove_spaces, ab_remove_nonprint)
ElseIf ab_remove_nonprint Then
// Remove nonprintable characters from the beginning and end
// of a string.
as_source = of_LeftTrim (as_source, ab_remove_spaces, ab_remove_nonprint)
as_source = of_RightTrim(as_source, ab_remove_spaces, ab_remove_nonprint)
ElseIf ab_remove_spaces Then
//Remove spaces from the beginning and end of a string.
as_source = Trim(as_source)
End If
return as_source
end function