Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP vs C# String handling
Message
De
23/05/2011 12:16:52
 
 
À
23/05/2011 11:49:11
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01511379
Message ID:
01511483
Vues:
77
IndexOf(searchword,System.StringComparison.CurrentCultureIgnoreCase
http://msdn.microsoft.com/en-us/library/ms224425.aspx


>>>My point was that in C# since there is no way to do a case insensitive search you have to do in effect three searches (yes, I realize there would be other possible combinations of upper and lower but these are in fact the three most likely )
>>
>>There is actually. But you'll need to write a method that uses String.IndexOf() in a loop http://msdn.microsoft.com/en-us/library/ms224424.aspx
>>You can pass an offset where the search starts in the string and StringComparison
>>
>
>Sorry, I'm being a little thick. I'm looking at the link and I see how IndexOf finds the first occurrence of a string but beyond that I'm not getting how it finds a string wtihout regard to case?? and even moreso, how it counts the number of occurrences in that larger string ?
>
>Could you point to and example of the kind of method you are talking about ?
>
>TIA
>
>>
>>>You were saying that in VFP the case insensitive search would take longer than the case sensitive search which is true. But to get the same outcome, one needs to do as I did in C# - search three times ( sensitively ). So, while each pass may be faster than the one insensitive pass, the cumulative time is still greater. No?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform