查找特定索引中包含的值/数据 [英] Find value/data contains in a specific index

查看:62
本文介绍了查找特定索引中包含的值/数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我可以知道是否有任何教程/链接我可以学习如何找到索引中包含的值?例如,我有一个字符串,其值为Hello,索引o应为4,如何使用该4显示字符o?谢谢。



我能想到语法如lblHello.Text = str1.Index [4] .Value;



任何帮助都将不胜感激。

解决方案

根据你实际做的事情,你可以在你的字符串上使用SubString方法。



String上还有其他方法可以使用Intellisense查看或参考 http://msdn.microsoft.com/en-us/library/system.string(v = vs.110).aspx [ ^ ]

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.

解决方案

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[^]


这篇关于查找特定索引中包含的值/数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆