Click here to Skip to main content
15,895,799 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi, may I know is there any tutorial/links that I can learn how to find a value contained inside an index? For example, I have a string which value is "Hello", the index of "o" should be 4, how can I use that 4 to display the char "o"? Thank you.

I could think of syntax like lblHello.Text = str1.Index[4].Value;

Any help would be appreciated.
Posted
Comments
BillWoodruff 27-Nov-14 22:56pm    
Your question suggests to me that you need to learn the basic features of string operations in .NET. There's a two-part tutorial I think may be of value to you;

http://www.dotnetcurry.com/showarticle.aspx?ID=189

http://www.dotnetcurry.com/showarticle.aspx?ID=190
Jamie888 28-Nov-14 3:39am    
Yes. Thank you, I will look into it sir.

1 solution

Depending on what you're actually doing, you could use the SubString method on your string.

There are other methods on the String that you can see using Intellisense or refer to http://msdn.microsoft.com/en-us/library/system.string(v=vs.110).aspx[^]
 
Share this answer
 
Comments
Jamie888 28-Nov-14 0:42am    
Yes indeed, how can I forget about the SubString method. Thank you for your suggestion.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900