Advertisement
Guest User

Untitled

a guest
Nov 22nd, 2014
165
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. quantity = 1;
  2. product_type = Book;
  3. price = 12.00;
  4.  
  5. <Books>
  6. <Book>
  7. <Quantity>1</Quantity>
  8. <Price>12</Price>
  9. </Book>
  10. </Books>
  11.  
  12. string str = "1 Book price $12.00";
  13. string[] strArray = str.split(' ');
  14. quantity = Convert.toInt32(strArray[0]);
  15. product_type = strArray[1] ;
  16. price = Convert.toDecimal(strArray[2].replace("$","") );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement