C# - Convert to string the significant part from a hex/ulong value -


how can take string significant part of hex/ulong number?

for example, if have 0x00000321321, want "321321".

if try like:

ulong x = 0x0000023632763; string s = x.tostring(); 

i 593700707, not want.

is possible ?

thank you!

use tostring(string format) override standard hexadecimal formatting "x" , along trimstart() rid of leading zeros:

string s = x.tostring("x"); 

(thanks keith n. pointing out trim not necessary.)


Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -