Hi, i got some problems with remove and split:
i have the outputs, as below:
{1 2} 3

How to remove the syimbol {} and split the 3 ?for example. it will become

1 2

anyone know? Please help me..

String original = "{1 2} 3";
String temp = original.Replace("{","").Replace("}","");
int pos = temp.LastIndexOf(' ');
String first = temp.Substring(0, pos);
String last = temp.Substring(pos+1);

Thanks for help, may i ask how to add those value to sortedlist?
In this case, 1 2 is key and 3 is the value of the sortedlistbut 3 must be as double.

sortedlist.Add(?,? );

I am currently studied in UMT and doing my final year project, lol

sortedlist.Add(first, last);

Did you not read the post of Momerath?
Just fill in first and last(converted to double)

1 more question, how to convert last to double type? because my sortedlist is Dictionary<string,double>sortlist=new Dictionary<string,double>();

Thanks for all the helps, really appreciate it.

Excuse me, after I tried the codes, i found that the codes just can functioned for output {1 2} 3, let say, my output as below:
{1 2} 3
{1 2 6} 7
{1 3 4} 3
{1 5} 3

how to split?I want to split number after "}" because i want add the number as value into sortedlist and the numbers inside "{}" as keys in sortedlist.
Sorry if my question not clear.

Did you try the code you already had?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.18 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.