of_lefttrim


pfcapsrv.pbl   >   pfc_n_cst_string   >   of_lefttrim   

Full name pfc_n_cst_string.of_lefttrim
Access public
Extend of string
Return value string
Prototype public function string of_lefttrim(string,boolean,boolean)

Name Datatype
No Data

Name Datatype
lb_char boolean
lb_printable_char boolean
lc_char char
ls_null string

public function string of_lefttrim (string as_source, boolean ab_remove_spaces, boolean ab_remove_nonprint);//////////////////////////////////////////////////////////////////////////////
//
//	Function:  		of_LeftTrim
//
//	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 end of the string.
//						If any argument's value is NULL, function returns NULL.
//
//	Description: 	Removes desired characters from the left end of a string.
//						The options depending on the parameters are:
//							Remove spaces from the beginning of a string.
//							Remove nonprintable characters from the beginning of a string.
//							Remove spaces and nonprintable characters from the beginning 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.
//
//////////////////////////////////////////////////////////////////////////////

char		lc_char
boolean	lb_char
boolean	lb_printable_char

//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 of a string.
	do while Len (as_source) > 0 and not lb_char
		lc_char = as_source
		if of_IsPrintable(lc_char) and Not of_IsSpace(lc_char) then
			lb_char = true
		else
			as_source = Mid (as_source, 2)
		end if
	loop
	return as_source
ElseIf ab_remove_nonprint Then
	// Remove nonprintable characters from the beginning of a string.
	do while Len (as_source) > 0 and not lb_printable_char
		lc_char = as_source
		if of_IsPrintable(lc_char) then
			lb_printable_char = true
		else
			as_source = Mid (as_source, 2)
		end if
	loop
	return as_source
ElseIf ab_remove_spaces Then
	//Remove spaces from the beginning of a string.
	return LeftTrim(as_source)
End If

return as_source


end function

     
Name Owner
pfc_n_cst_string.of_lefttrim pfc_n_cst_string
pfc_n_cst_string.of_lefttrim pfc_n_cst_string
pfc_n_cst_string.of_trim pfc_n_cst_string
pfc_n_cst_inifile.of_getsections pfc_n_cst_inifile
pfc_n_cst_inifile.of_getkeys pfc_n_cst_inifile
pfc_n_cst_inifile.of_delete pfc_n_cst_inifile
pfc_n_cst_inifile.of_delete pfc_n_cst_inifile

     
Name Owner
systemfunctions.isnull systemfunctions
systemfunctions.lefttrim systemfunctions
systemfunctions.len systemfunctions
systemfunctions.mid systemfunctions
systemfunctions.setnull systemfunctions
pfc_n_cst_string.of_isspace pfc_n_cst_string
pfc_n_cst_string.of_isprintable pfc_n_cst_string

     
Full name
No Data

     
Name Scope
No Data