Mondeo Posted June 20, 2007 Posted June 20, 2007 Hi, If I have the following strings Vauxhall Corsa 1.2 XS 5 Door 1.4 Citroen Saxo Red Ford Escort Si 1.6i I need to pass them to a function and get the engine sizes out. So for these examples 1.2 1.4 1.6 All the engine sizes will be in the same format number - full stop/period -number. I'm guessing regex might do it but never used before. Thanks Quote
mskeel Posted June 22, 2007 Posted June 22, 2007 Regex is a perfect candidate for this. Something like Regex.Match would probably do the trick. The regular expression might look something like [0-9]\.[0-9] which says "any single digit 0-9 followed by a . followed by any single digit 0-9. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.