BigInteger到十六进制 [英] BigInteger to Hexadecimal

查看:212
本文介绍了BigInteger到十六进制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

快速提问...

我有一个很长的BigInteger,我想以十六进制字符串的形式写入文件.

I have a stupidly long BigInteger which I would like to write to a file as a hex string.

我知道Java提供了实现此功能的.toString(16)方法,但是我找不到C#中的等效方法.

I know Java provides the .toString(16) method which does this, but I can't find an equivalent in C#.

我正在使用.NET 4.0中的System.Numerics.BigInteger.

I'm using System.Numerics.BigInteger from .NET 4.0.

谢谢

推荐答案

根据您喜欢的情况使用.ToString("X").ToString("x").

Use .ToString("X") or .ToString("x") depending on what case you prefer.

这篇关于BigInteger到十六进制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆