Hi all,
I need some help in finding some specific text from a string.
For Example;
String Text = “DataA:2345.9, DataB:1234.7, DataC:87659.2, DataD:987241………..DataM:2345.0”
DataA/B/C is the name of Data Value (and is for example, actual names are quite different to each another, but are same to other strings) and values are in between “:” and “,”.
First Step: I want to search about complete data, If String has all Data names and its values (In above example from DataA to DataM) than application should have to proceed to Second step otherwise set high or low one flag bit just to highlight that corresponding String don’t have complete data (Setting flag bit is not difficult for me). The problem is to find out “Data names” inside message in First step; I tried different search commands but failed to do so. The only way I found is to search for a character inside text string, which is a lengthy process to find each character individually as don’t know the correct index of character due to different values.
Second Step: I want to copy DataA, DataB, DataC and other Data values to save as a XML or Text file. This is difficult for me to split one string in different ways. As in one string there are so many Names and their values.
I need help in this and waiting for any response.
Thanks
I need some help in finding some specific text from a string.
For Example;
String Text = “DataA:2345.9, DataB:1234.7, DataC:87659.2, DataD:987241………..DataM:2345.0”
DataA/B/C is the name of Data Value (and is for example, actual names are quite different to each another, but are same to other strings) and values are in between “:” and “,”.
First Step: I want to search about complete data, If String has all Data names and its values (In above example from DataA to DataM) than application should have to proceed to Second step otherwise set high or low one flag bit just to highlight that corresponding String don’t have complete data (Setting flag bit is not difficult for me). The problem is to find out “Data names” inside message in First step; I tried different search commands but failed to do so. The only way I found is to search for a character inside text string, which is a lengthy process to find each character individually as don’t know the correct index of character due to different values.
Second Step: I want to copy DataA, DataB, DataC and other Data values to save as a XML or Text file. This is difficult for me to split one string in different ways. As in one string there are so many Names and their values.
I need help in this and waiting for any response.
Thanks