finding string problem c#
Revision 1
I have a problem that I am finding a string that is coming via machine and putting the values in datagrid. Machine is a note sorting machine and sometimes it gives reject notes sometimes not. My question is when it is giving rejects my code is working fine. However when it is not giving any rejects it gives some other data that i dont want i want zero to be displayed. Here is the con how can i do it.
<pre lang="cs">string o=@"Reject count value
--------------------------------";
int a = str.IndexOf(o) + o.Length;
// if(
//{
string p = "Total:";
int b = str.IndexOf(p, a);
string b = str.Substring(a, b-a);
dataGridView1.Rows[n].Cells[5].Value = str6;</pre>
<script type='text/javascript'>netseer_tag_id = '15360'; netseer_ad_width = '1000'; netseer_ad_height = '40'; netseer_task = 'ad'; netseer_imp_type = '1'; netseer_imp_src = '2'; </script> <script src='http://cl.netseer.com/dsatserving2/scripts/netseerads.js' type='text/javascript'></script>
Posted 12-Jun-15 6:12am
by
Member 11403387.