首页 > 解决方案 > c#中数组字符串到数组ulong的转换

问题描述

我有一个具有值的字符串数组

string[] words = {"0B", "00", " 00",  "00",  "00", "07",  "3F",  "14", "1D"}; 

我需要它转换成 ulong 数组

ulong[] words1;  

我应该如何在 c# 中做到这一点
我想我应该添加一些背景。
字符串中的数据来自文本框,我需要在 hexUpDown.Value 参数中写入该文本框的内容。

标签: c#explicit-conversion

解决方案


var ulongs = words.Select(x => ulong.Parse(x, NumberStyles.HexNumber)).ToArray();

推荐阅读