LibreOfficeDev 24.8 Help
ត្រឡប់ផ្នែកដែលបានបញ្ជាក់នៃកន្សោមខ្សែអក្សរ (អនុគមន៍ Mid) ឬជំនួសផ្នែកនៃកន្សោមខ្សែអក្សរមួយជាមួយខ្សែអក្សរមួយទៀត (សេចក្តីថ្លែងការណ៍ Mid) ។
Mid (Text As String, Start As Long [, Length As Long]) or 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.
ប្រសិនបើប៉ារ៉ម៉ែត្រ Length ក្នុង អនុគមន៍ Mid ត្រូវបានលុប តួអក្សរទាំងអស់ក្នុងកន្សោមខ្សែអក្សរពីទីតាំងចាប់ផ្តើមរហូតដល់ចុងនៃខ្សែអក្សរត្រូវបានត្រឡប់ ។
ប្រសិនបើប៉ារ៉ាម៉ែត្រ Length ក្នុង សេចក្តីថ្លែងការណ៍ Mid តិចជាងប្រវែងអត្ថបទដែលអ្នកចង់ជំនួស អត្ថបទត្រូវបានបន្ថយមកត្រឹមប្រវែងជាក់លាក់មួយ ។
Text ៖ ខ្សែអក្សរដើម្បីជំនួសកន្សោមខ្សែអក្សរ (សេចក្តីថ្លែងការណ៍ Mid) ។
Sub ExampleUSDate
Dim sInput As String
Dim sUS_date As String
sInput = InputBox("Please input a date in the international format 'YYYY-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