Monday, 15 March 2010

c# - Extract string parts that are separated with commas -


Can someone help me remove the string in 3 different variables?

The input from the user is 13, g, true in this format. I want to store the number in int , in a char and true in a string .

But I do not know how to specify a comma location, before or after the cameras can be stored in another variable. I do not have permission to use the LastIndexOf method.

I'm really new to programming.

  string msg = "13, g, truth"; Var myArray = msg.Split (","); // Pars the number of elements; Expose the exception to the new logic ("intra-intra-input format for the number"); string characters = myArray [1]; string b = myArry [2]; // if (! Int32.TryParse (myArray [0], outside number); Expose the new logic ("Swirl input format for boolean");  

No comments:

Post a Comment