c# - c#中数组字符串到数组ulong的转换
问题描述
我有一个具有值的字符串数组
string[] words = {"0B", "00", " 00", "00", "00", "07", "3F", "14", "1D"};
我需要它转换成 ulong 数组
ulong[] words1;
我应该如何在 c# 中做到这一点
我想我应该添加一些背景。
字符串中的数据来自文本框,我需要在 hexUpDown.Value 参数中写入该文本框的内容。
解决方案
var ulongs = words.Select(x => ulong.Parse(x, NumberStyles.HexNumber)).ToArray();
推荐阅读
- c++ - decltype 的参数不正确
- mysql - Spark - 通过 Zeppelin EMR 连接到 mysql
- javafx - JavaFX CSS 两像素边框
- ruby-on-rails - 散列作为参数和默认参数值
- javascript - Javascript如何将值粘贴到用户名中
- java - 尽管我得到了正确的答案,但我一直被告知我在 Kattis 上的答案是错误的
- php - 如何在 PHP 的 3 页之间获取变量
- php - 数不清
- laravel - Laravel guzzle 身份验证不起作用
- buildbot - 当 BuildSlave 有几个 builder 时,你怎么知道哪个 builder 忙呢?