**======================================================================= ** ReduceChars(StringToReduce, CharacterReduced) **----------------------------------------------------------------------- ** Description: ** Converts multiple contigous characters into a single character. ** Ex: ? ReduceChars("My Name", " ") && (returns: "My Name") **----------------------------------------------------------------------- ** Parameters: ** StringToReduce: ** The string to reduce ** CharacterReduced: ** The character that is searched for and converted. **----------------------------------------------------------------------- ** Returns: ** The reduced string **----------------------------------------------------------------------- Function ReduceChars Lparameters StringToReduce, CharacterReduced Local RetVal, DoubleChar RetVal = StringToReduce DoubleChar = CharacterReduced + CharacterReduced Do While DoubleChar $ RetVal RetVal = Strtran(RetVal, DoubleChar, CharacterReduced) Enddo Return RetVal Endfunc>Hello All,
>cStringIn = 'Peter the embedded space man'
>
>
>cStringOut = 'Peter the embedded space man'
>
>
>
>
>
>many thanks
>
>Pete KaneRoi
'MCP' Visual FoxPro
In Rome, there was a poem.
About a dog, who found two bone.
He lick the one, he lick the other.
He went pyscho, he drop dead!