Skip to content

Celsius

Giuseppe Cannella edited this page Feb 19, 2020 · 2 revisions
Type name example
Celsius -2.2 °C
import com.github.gekomad.regexcollection.Celsius                         
import com.github.gekomad.regexcollection.Validate.validate               
                                                                          
assert(validate[Celsius]("133") == None)                                  
assert(validate[Celsius]("2 °C") == Some("2 °C"))                         
assert(validate[Celsius]("+2 °C") == Some("+2 °C"))                       
assert(validate[Celsius]("-2.2 °C") == Some("-2.2 °C"))                                                                                                                                                                           
Clone this wiki locally