从C#windows应用程序中的字符串中删除值 [英] Remove value from string in C# windows application

查看:80
本文介绍了从C#windows应用程序中的字符串中删除值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有数组值123456789123456789000001,RSSI = -31.2我需要 删除 ,RSSI = -31.2

如何在C#windows应用程序中获取此内容





感谢All

Hi All
I have array value "123456789123456789000001,RSSI=-31.2" where I need to remove ",RSSI=-31.2 "
How can I get this in C# windows application


Thanks to All

推荐答案

string something = mainstring.Replace("RSSI=-31.2", string.Empty) 

- 应该这样做。


string your_string = "123456789123456789000001,RSSI=-31.2";
string[] parts= your_string.Split(',');
parts[0]= //this will be your required string that is "123456789123456789000001"



问候..:)


Regards..:)


If you have charArray convert it to string then split it using char ','.
You will get 2 string values.
Convert the first string to charArray and that your required output.

string arrayString = Convert.ToString(charArray);
                string[] splitString = arrayString.Split(new char[] { ',' }, StringSplitOptions.None);
                char[] output = splitString[0].ToCharArray();


这篇关于从C#windows应用程序中的字符串中删除值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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