将整数格式化为八进制

thr*_*thr 9 .net c# vb.net f# number-formatting

我正在寻找String.Format()的格式说明符(或者如果有一个将要执行它的NumberFormatInfo类)在.NET中将整数格式化为八进制,将其 {0:x}格式化为十六进制,例如:

String.Format("{0:x}", 15) // returns "f"
Run Code Online (Sandbox Code Playgroud)

thr*_*thr 15

System.Convert.ToString(15, 8)