Class: OoxmlParser::StringHelper
- Inherits:
-
Object
- Object
- OoxmlParser::StringHelper
- Defined in:
- lib/ooxml_parser/helpers/string_helper.rb
Overview
Class for working with strings
Class Method Summary collapse
-
.complex?(string) ⇒ True, False
Check if string is complex number.
-
.numeric?(string) ⇒ True, False
This method check if string contains numeric.
Class Method Details
.complex?(string) ⇒ True, False
Check if string is complex number
17 18 19 20 21 |
# File 'lib/ooxml_parser/helpers/string_helper.rb', line 17 def complex?(string) true if Complex(string.tr(',', '.')) rescue ArgumentError false end |
.numeric?(string) ⇒ True, False
This method check if string contains numeric
9 10 11 12 13 |
# File 'lib/ooxml_parser/helpers/string_helper.rb', line 9 def numeric?(string) true if Float(string) rescue ArgumentError false end |