[r2]: / trunk / Functions / CLEANSTRING / svnobj  Maximize  Restore  History

Download this file

5 lines (5 with data), 4.3 kB

Gx_lª!0…jüo‰v¥DùÌÂDèSystem.StringL{6f9dac99-8de1-4efc-8465-68ac443b7d08}SpecialFuncL{0db3d7bb-cde0-4416-9a7b-ce49a0124323}NoneImplementationL{3b83b776-fb25-43b8-99f2-3c507c9143fc}TextDocument	L{f3878285-8e4f-490b-bb1b-9acbb7eb04db}
TextLinesL{a5de0b0b-1cb5-4913-ac21-9d70293ec00d}Id
longTagTextÒ(*=======================================================================================================CLEANSTRING()VAuthor: Tim Van Meppelen, Pro Electric Inc.(timv@proelectric.com"Date: Oct 9, 2018jstrip all control characters and spaces from a stringÔ========================================================================================================*)>FOR i:= 1 TO MAXSTRINGLENGTH DOt	IF (StringPtr^[i] >= 1) AND (StringPtr^[i] <= 16#20) THEN¶	//match all control and white space characters, except for null, which terminates a stringB		FOR j:= i TO MAXSTRINGLENGTH DOD			IF (StringPtr^[j] = 16#00) THENJ			//null character terminates string				EXIT;			ELSE F			//shift character array left one!H				StringPtr^[j]:= StringPtr^[j+1];"			END_IF#		END_FOR$\		i:= i - 1;	//run loop at same position again%F	ELSIF (StringPtr^[i] = 16#00) THEN&`	//found null character at the end of the string'		EXIT;(	END_IF)END_FOR*&CLEANSTRING:= TRUE;+Interface,L{a9ed5b7e-75c5-4651-af16-d2c27e98cb94}-6FUNCTION CLEANSTRING : BOOL.VAR_INPUT/t	StringPtr:		POINTER TO ARRAY[1..MAXSTRINGLENGTH] OF BYTE;0END_VAR1VAR CONSTANT2<	MAXSTRINGLENGTH:	UINT:= 2048;3VAR4	i:				UINT;5	j:				UINT;6"UniqueIdGenerator7498POULevel9L{8e575c5b-1d37-49c6-941b-5c0ec7874787}:Standard; ChildObjectGuids<8System.Collections.ArrayList=,AddAttributeSubsequent>boolÐÐ-ÐÐ	E
ÐÐ
­ÚÐ-ÐÐ
­	ÚÐ-ÐÐ
­
ÚÐ-ÐÐ
­ÚÐ-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