需要这个问题的帮助 [英] Need help in this question

查看:85
本文介绍了需要这个问题的帮助的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好



以下是我的代码



Hi all

below is my code

string data = text;

           data = data.Trim();
           string[] arr;
           arr = data.Split(new[] { "CS" }, StringSplitOptions.None);
           lblw.Content = arr[10].Substring(0, 4);





在此变量 string [] arr; 包含类似
的数据




In this the variable string[] arr; contains data like

"?\b??ML??0151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151\r00151"




在lblw.content中我想要0151.数据来自串口。



请告诉我怎么样这样做。



In lblw.content i want 0151. the data is coming from serial port.

Please tell me how to do this.

推荐答案

在\r上拆分数组,然后显示第3或第4项(所有这些都是相同的)。
Split the array on \r and then display the 3rd or 4th item (all of them seem to be same).


这篇关于需要这个问题的帮助的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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