2016-11-08 1 views
-3

文字列「hello」を含むテキストボックスがあるとします。テキストボックスビジュアルベーシックの特定の文字をチェックしますか?

textbox.text = "l"の3文字目を確認する方法はありますか?

もちろん、視覚的な基本について話しています。

ありがとうございます!

+3

のようにそれを呼び出して、この機能を使用することができます。これはあなた自身で問題を解決する努力を示していません。 VB.NET IsNot vba – Plutonix

+0

[文字列内で部分文字列の有無を検索する](http://stackoverflow.com/documentation/vba/3480/searching-within-strings-for-the-presence-of-substrings#t= 201611081817391650478)、このページの[Documentation]ボタンをクリックしてください。 –

+0

[** 'String.Chars()'プロパティ**](https://msdn.microsoft.com/en-us/library/system.string.chars(v = vs.110).aspx)。 –

答えて

0

あなたは

Private Function checkCharacter(thisString As String, 
           searchCharacter As Char, 
           index As Integer) 
    Try 
     Return thisString(index) = searchCharacter 
    Catch 
     Return False 
    End Try 
End Function 

を読む[掲載]と[ツアー]を行ってください。この

Dim result As Boolean = checkCharacter(TextBox1.Text, "l"c, 2) 
関連する問題