LibreOfficeDev 25.2 ヘルプ
文字列表式の中から指定部分を取得して返す (Mid 関数) か、該当部分を他の文字列に置き換えます (Mid ステートメント)。
Mid (Text As String, Start As Long [, Length As Long])
Mid (Text As String, Start As Long, Length As Long, Text As String)
文字列 (関数のみ)
Text: 操作対象とする文字列表式。
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.
Mid 関数 の場合、Length パラメーターを指定しないと、指定文字列の開始位置から末尾までが返されます。
Mid ステートメント の場合、Length パラメーターの値が置き換えるテキストよりも短いと、この長さにテキストが切りつめられます。
Text: 文字列表式を置き換える文字列 (Mid ステートメント)。
Sub ExampleMid_Function_and_Statement
original_text = "This is the original Text"
' Mid as function
msgbox Mid( original_text , 13, 8) ' returns the word original
msgbox original_text ' original_text not modified
' Mid as statement
Mid( original_text, 13, 8, "new" )
msgbox original_text ' returns This is the new Text
End Sub