Run Code  | API  | Code Wall  | Misc  | Feedback  | Login  | Theme  | Privacy  | Patreon 

get_hex_value_if_hex_string

Language: Layout:
+ ] Compiler args + ] Show input
Compilation time: 0.25 sec, absolute running time: 0.2 sec, cpu time: 0.09 sec, memory peak: 3 Mb, absolute service time: 0,57 sec 
edit mode |  history
test string AfbC19073
index = 0, char = A, charcode = 65, offset = 17, value = 10, 
index = 1, char = f, charcode = 102, offset = 54, value = 15, 
index = 2, char = b, charcode = 98, offset = 50, value = 11, 
index = 3, char = C, charcode = 67, offset = 19, value = 12, 
index = 4, char = 1, charcode = 49, offset = 1, value = 1, 
index = 5, char = 9, charcode = 57, offset = 9, value = 9, 
index = 6, char = 0, charcode = 48, offset = 0, value = 0, 
index = 7, char = 7, charcode = 55, offset = 7, value = 7, 
index = 8, char = 3, charcode = 51, offset = 3, value = 3, 
code = 3, (string is hexadecimal.)

test string ABcD1-9073
index = 0, char = A, charcode = 65, offset = 17, value = 10, 
index = 1, char = B, charcode = 66, offset = 18, value = 11, 
index = 2, char = c, charcode = 99, offset = 51, value = 12, 
index = 3, char = D, charcode = 68, offset = 20, value = 13, 
index = 4, char = 1, charcode = 49, offset = 1, value = 1, 
code = -1, (if -1 string not hexadecimal.)


    
                
λ
.NET NoSQL database for rapid development