How to get the 3rd character in a string

Well the title says it all

Let's say i have the string: "abcdefg"
i want to get the 3rd character (ie: "c") what is the function to do so?

This shouln't be too difficult to do
i know in excel the STXT function does it

TIAFYT (thanks in advance for your time)

Who is Participating?
schworakConnect With a Mentor Commented:
Use the MID function


MID("abcdefg",3,1) returns "c"
lutharAuthor Commented:
Edited text of question.
lutharAuthor Commented:
Good comment but here's my code:
Option explicit
Dim Nbr_de_coup as integer

Private Sub Form_load()
Genere_La_Solution (Nbr_de_coup)
End sub
Public Function Genere_La_Solution(ByVal Nbr_de_Case)

Dim x As Integer
Dim Nbr_Genere As String

    For x = 0 To Nbr_de_Case
        Let Nbr_Genere = Int(Rnd() * 5)
        Solution = Solution & Nbr_Genere
    Next x
End Function
Public Sub Label1_Click(Index As Integer)
Dim i As Integer

Nbr_de_coup = Nbr_de_coup + 1

For i = 1 To Len(Solution)
Reponse = Mid(Solution, i, 1)
If Reponse <> Index Then
    MsgBox "Vous avez pousser une mauvaise touche!", vbOKOnly, "Que c'est dommage!"
    Exit Sub
End If
Next i

I get an error at the If Response <>...

Any suggestion?
The new generation of project management tools

With’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

RESPONSE is a STRING, INDEX is an INTEGER. You can't compare an Integer to a String and get meaningful results...

Is this what you are trying to do?
i = InStr(1, solution, Format(Index))
If i <> Index Then
    MsgBox "Vous avez pousser une mauvaise touche!", vbOKOnly, "Que c'est dommage!"
    Exit Sub
End If
lutharAuthor Commented:
Sounds more like it but the only problem is that I need the result to be different than 0 or 1 cause i have 5 label in the control array...
I'm gonna put more points cause i think it's worth more :D
To convert a integer to a string use STR$(num). To convert from a string to a number use VAL("string").
All Courses

From novice to tech pro — start learning today.