Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Removing embedded spaces
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00561036
Message ID:
00561065
Views:
25
I saw something like this from Dragan Nedeljkovich, but I'm not 100% sure. I'll try to search...

Oops, seems like we have problems with Search again :(

>Hi Pete,
>I found the following on the UT somewhere and I'm not sure who the orig author was. UT search is down again so I couldn't find it.
>
>
**=======================================================================
>**	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,
>>easy peasy one for you experts, I need a function to remove extraneous embedded spaces from a given string of multiple words, and wondered if any of you have experience in this area, an example of I show below
>>
>>

>>cStringIn = 'Peter the embedded space man'
>>
>>
>>cStringOut = 'Peter the embedded space man'
>>
>>

>>
>>
>>
>>many thanks
>>
>>Pete Kane
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform