Visual basic

cs_1108 Messages postés 1 Date d'inscription jeudi 20 février 2003 Statut Membre Dernière intervention 20 février 2003 - 20 févr. 2003 à 16:31
BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019 - 20 févr. 2003 à 19:20
comment fonction la fonction mid dans le visual basic

1 réponse

BruNews Messages postés 21040 Date d'inscription jeudi 23 janvier 2003 Statut Modérateur Dernière intervention 21 août 2019
20 févr. 2003 à 19:20
Public Shared Function Mid( _
ByVal Str As String, ByVal Start As Integer, _
Optional ByVal Length As Integer _
) As String
Str : Required. String expression from which characters are returned.
Start
Required. Integer expression. Character position in Str at which the part to be taken starts. If Start is greater than the number of characters in Str, the Mid function returns a zero-length string (""). Start is one based.
Length
Optional. Integer expression. Number of characters to return. If omitted or if there are fewer than Length characters in the text (including the character at position Start), all characters from the start position to the end of the string are returned.

Dim MyString, FirstWord, LastWord, MidWords As String
MyString = "Mid Function Demo" ' Creates text string.
FirstWord = Mid(MyString, 1, 3) ' Returns "Mid".
LastWord = Mid(MyString, 14, 4) ' Returns "Demo".
MidWords = Mid(MyString, 5) ' Returns "Function Demo".

TOUT CECI ISSU DE MSDN
ciao...
0
Rejoignez-nous