OVH Cloud OVH Cloud

Je souhaiterai recuperé ds info ds une chaine de caractere

5 réponses
Avatar
DEDE
Salut à tous,

Je souhaiterai recuperé ds info ds une chaine de caractere

ex : "azertyuiopqsdfghjklm" je ve recuperé de la lettre "t" à "d" je pensé
faire ac la position ici 4éme caractere o 13!

Quel comande j doi utilisé ?

Merci

5 réponses

Avatar
Yan
Salut,

Dim chaine As String = "azertyuiopqsdfghjklm"
MsgBox(Mid(chaine, 4, 9))
A+
Yan


"DEDE" a écrit dans le message de news:

Salut à tous,

Je souhaiterai recuperé ds info ds une chaine de caractere

ex : "azertyuiopqsdfghjklm" je ve recuperé de la lettre "t" à "d" je pensé
faire ac la position ici 4éme caractere o 13!

Quel comande j doi utilisé ?

Merci




Avatar
YB
Ou plutot :
chaine.Substring(4, 9)

YB
Avatar
Sebdraluorg
Salut,

Eh peux tu etre un peu plus clair ?

Que dois tu faire exactement ?

D'apres ce que je comprends, je dirais de faire ainsi:

Dim StringA As String = TextBox1.Text
Dim StringB As String
Dim SResult As String
Dim pos As Integer = InStr(StringA, "t")
If pos > 0 Then
StringB = Microsoft.VisualBasic.Right(StringA, StringA.Length -
pos)
pos = InStr(StringB, "d")
If pos > 0 Then
SResult = Microsoft.VisualBasic.Left(StringB, pos - 1)
End If
End If
If Not SResult Is Nothing Then MsgBox(SResult)

++

"DEDE" a écrit :

Salut à tous,

Je souhaiterai recuperé ds info ds une chaine de caractere

ex : "azertyuiopqsdfghjklm" je ve recuperé de la lettre "t" à "d" je pensé
faire ac la position ici 4éme caractere o 13!

Quel comande j doi utilisé ?

Merci





Avatar
DEDE
Avatar
DEDE
re
j reussi ac aide:


circuit = (Mid(TextLine, 20, 8))
numero = (Mid(TextLine, 31, 15))
plan = Trim(circuit) & Trim(numero)

a+


"Sebdraluorg" a écrit dans le
message de news:
Salut,

Eh peux tu etre un peu plus clair ?

Que dois tu faire exactement ?

D'apres ce que je comprends, je dirais de faire ainsi:

Dim StringA As String = TextBox1.Text
Dim StringB As String
Dim SResult As String
Dim pos As Integer = InStr(StringA, "t")
If pos > 0 Then
StringB = Microsoft.VisualBasic.Right(StringA,


StringA.Length -
pos)
pos = InStr(StringB, "d")
If pos > 0 Then
SResult = Microsoft.VisualBasic.Left(StringB, pos - 1)
End If
End If
If Not SResult Is Nothing Then MsgBox(SResult)

++

"DEDE" a écrit :

> Salut à tous,
>
> Je souhaiterai recuperé ds info ds une chaine de caractere
>
> ex : "azertyuiopqsdfghjklm" je ve recuperé de la lettre "t" à "d" je


pensé
> faire ac la position ici 4éme caractere o 13!
>
> Quel comande j doi utilisé ?
>
> Merci
>
>
>