Click here to Skip to main content
16,010,470 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted

C#
string something = mainstring.Replace("RSSI=-31.2", string.Empty) 
-- should do it.
 
Share this answer
 
v3
C#
string your_string = "123456789123456789000001,RSSI=-31.2";
string[] parts= your_string.Split(',');
parts[0]= //this will be your required string that is "123456789123456789000001"

Regards..:)
 
Share this answer
 
Comments
ridoy 13-Sep-13 3:26am    
exactly which i will give as a solution,a 5!
Thanks7872 13-Sep-13 3:28am    
Thanks ridoy. I still remember your feedback about Splite typo...!
ridoy 13-Sep-13 3:33am    
:) :),you also turn me to remember that now!
Thanks7872 13-Sep-13 3:34am    
:-)
Maciej Los 13-Sep-13 3:37am    
+5
XML
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();
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900