LibreOffice 7.3 Help
Zwraca określony fragment ciągu (funkcja Mid) lub zamienia fragment ciągu innym ciągiem (instrukcja Mid).
Mid (tekst As String, start As Long [, długość As Long]) lub Mid (tekst As String, start As Long , długość As Long, tekst As String)
Ciąg (tylko w przypadku funkcji)
Tekst: Dowolne wyrażenie w postaci ciągu, które ma zostać zmodyfikowane.
Start: Numeric expression that indicates the character position within the string where the string portion that you want to replace or to return begins. The minimum allowed value is 1. The maximum allowed value is 2,147,483,648.
Length: Numeric expression that returns the number of characters that you want to replace or return. The maximum allowed value is 2,147,483,648.
Jeśli parametr "długość" w funkcji Mid zostanie pominięty, zwracane są wszystkie znaki od punktu początkowego aż do końca ciągu.
Jeśli parametr "długość" w instrukcji Mid jest mniejszy niż długość tekstu, który ma zostać zamieniony, tekst jest skracany do określonej długości.
Tekst: Ciąg zastępujący wyrażenie w postaci ciągu (instrukcja Mid).
Sub ExampleUSDate
Dim sInput As String
Dim sUS_date As String
sInput = InputBox("Wprowadź datę w formacie międzynarodowym 'RRRR-MM-DD'")
sUS_date = Mid(sInput, 6, 2)
sUS_date = sUS_date & "/"
sUS_date = sUS_date & Right(sInput, 2)
sUS_date = sUS_date & "/"
sUS_date = sUS_date & Left(sInput, 4)
MsgBox sUS_date
End Sub