Thursday 15 September 2011

asp.net - How to get selected data from string -


I'm back as a string some data and selected data from the string (B / W Form Tags) I want to receive.

  string ReturnURlData = "hbhjbhjb hjbhjbhjb hjbhj & lt; br / & gt; vhbvhbhjjjbjjbhj jknknkjk & LT; form name = ADD action = 'cart.asp' önSubmit = 'return checkAllQuantities () ; ' Method = Post & gt;   

// -------- I want to get data from here

  & lt; tr & gt; & lt; td class = "ROC_SellrCartRow" & gt; Menu18 & lt; / td & gt; & lt; td class = "ROC_SellrCartRow" & gt; cheese & lt Burger quarter-pounder; / td & gt; & lt; td class = "ROC_SellrCartRow" & gt; & lt; input type = hidden ID = Hidden5 value = 0 & gt; & lt; input type = hidden ID = 6maxQuantity value = 9999999 & gt; & lt; input type = hidden id = 6minQuantity value = 1 & gt; & lt; input type = hidden name = 6basketitemid value = 90,265,465 & gt; & lt; input class = ROC_quantityfield type = p Page id = 6quantity onClick = 'return change action (1);' Onfocus = 'Return change action (1);' Onkeyup = 'userChangedQuantity (6, false);' OnChange = 'userChangedQuantity (6, true);' Maxlength = 6 size = 3 name = 6newquantity value = 8>  gt; & lt; / td & gt; & lt; td class = "ROC_SellrCartRow"> £ 23.20 & lt; / td & gt; & lt; / tr & gt;   

// -------- (end here)

  & lt ; Form & gt; hjbhjbhjhjhbhjubhjuubhbhjubhjubu hbhjhuh ";   

I know this is a minor task & amp; I can do it with 3-4 steps. But I want to know that we can do this in a single query. Any suggestions really appreciate.

Hello You can do this:

  string s = " ABC Pqr Xyz "; S = getBetween (S, "A", "z");   

Use the function below:

  public static string getBetween (string strSource, string strStart, string strEnd) {int start, end; If (strSource.Contains (strStart) & amp; strSource.Contains (strEnd)) {start = strSource.IndexOf (strStart, 0) + strStart.Length; End = strSource.IndexOf (Strand, Start); Return strSource.Substring (start, end-start); } Other {return ""; }   

}

No comments:

Post a Comment