Regex rx = new Regex( @"\.\d\d" );
Match m = rx.Match( "567.99" );
String s = m.Value;
s = s.Remove( 0, 1 );
MessageBox.Show( s ); //for windows app... just know s is what you want
Boulder - the cleaner way is to use a zero-width look behind assertion. These assertions are cool - they allow you to stipulate that the dot must be present without actually capturing the dot.
In this case, the reg exp is (?<=\.)\d\d
the (?<=\.) bit means that the two digits must be preceeded by a dot.
Then you don't need to string manip to remove the dot.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.