Onur,
The first I agree, it is converting the P in the middle as well, to lower.
But how can you convert a string with a P in the middle to a what you call a
numeric?
That can only by those who call a string with all numeric characters a
numeric, and therefore I did not extend the code for that part.
(By the way, I have tried the code, with that what you did, you can do the
same, as you then set a simple Cint before it, you can use it as any real
numeric value instead of a string, however this can in my idea never been
done in the way the Op was asking).
Cor
"kimiraikkonen" <
[email protected]> schreef in bericht
Tee,
dim Example as string = "P50001p".tolower.Trim("p")
http://msdn.microsoft.com/en-us/library/d4tt83f9.aspx
Cor
"engteng" <
[email protected]> schreef in
bericht
- Show quoted text -
Why are you trying to lower P? OP just wants to convert "P50001 to
50001" or "50001P to 50001". Plus, trimming 'P' is not enough alone,
also the string type must be converted to a numeric type such as
Integer for further usage. In this case, it's proper to take the part
of the string value that can be casted to Integer using CInt or
Convert.ToInt32 etc. (without 'P').
Thanks,
Onur G.