Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Chrtran() applied selectively
Message
From
06/06/2016 00:23:56
 
 
To
05/06/2016 19:45:14
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
01636985
Message ID:
01637029
Views:
84
>>>>>>If you have been able to locate the error portion, use something like
>>>>>>
>>>>>> substr(mstr,1 , pos-1) + '.' + substr(mstr, pos+1)
>>>>>>
>>>>>
>>>>>
>>>>>minimally faster and for my eyes easier to read...
>>>>>
>>>>> left(mstr, pos-1) + '.' + substr(mstr, pos+1)
>>>>>
>>>>
>>>>
>>>>STUFF(mstr,pos,1,'.')
>>>>
>>>
>>>yupp, forgot that one, which is better
>>
>>would this not ADD the dot to whatever is already there??
>
>No it won't - the 3rd parameter is the number of characters to replace/remove (the replacing string doesn't have to be the same length, so you can remove 2 and insert 23, or any other combination. Including zero, when it removes none - then it's an insert.

thanks dragan - I was not aware of that - I have only ever used it as an insert but this certainly makes a lot more sense. thank you for the response and clarification dragan.
k
Previous
Reply
Map
View

Click here to load this message in the networking platform