String.toBoolean?
Posted: Sun Jul 05, 2009 7:46 pm
I have roughly the following lines in one of my programs:
And I'm getting a compile error: "string" does not contain a definition for "ToBoolean".
I also tried
But was told that: Cannot find a definition for "toBool" in "setting" whose type is "String". There is a member named "toBoolean" with a similar name.
Someone's telling fibs...
Previously I tried
And was told: Cannot find "bool". The same is true if I try "ToBoolean".
How should I be converting a string into a boolean?
- Code: Select all
setting as String = "true"
option as bool = setting.toBoolean
And I'm getting a compile error: "string" does not contain a definition for "ToBoolean".
I also tried
- Code: Select all
setting as String = "true"
option as bool = setting.toBool
But was told that: Cannot find a definition for "toBool" in "setting" whose type is "String". There is a member named "toBoolean" with a similar name.
Someone's telling fibs...
Previously I tried
- Code: Select all
setting as String = "true"
option as bool = bool(setting)
And was told: Cannot find "bool". The same is true if I try "ToBoolean".
How should I be converting a string into a boolean?