MIDB

Returns a text string of a DBCS text. The parameters specify the starting position and the number of characters.

tip

This function is available since LibreOffice 4.2.


αžœαžΆαž€αŸ’αž™β€‹αžŸαž˜αŸ’αž–αž“αŸ’αž’β€‹β€‹

MIDB("Text"; Start; Number_bytes)

αž’αžαŸ’αžαž”αž‘ αž‚αžΊβ€‹αž‡αžΆβ€‹αž’αžαŸ’αžαž”αž‘β€‹αžŠαŸ‚αž›β€‹αž˜αžΆαž“β€‹αžαž½αž’αž€αŸ’αžŸαžšβ€‹αžαŸ’αžšαžΌαžœβ€‹αžŸαŸ’αžšαž„αŸ‹αž…αŸαž‰Β αŸ”

αž…αžΆαž”αŸ‹αž•αŸ’αžŠαžΎαž˜ αž‚αžΊβ€‹αž‡αžΆβ€‹αž‘αžΈαžαžΆαŸ†αž„β€‹αžšαž”αžŸαŸ‹β€‹αžαž½αž’αž€αŸ’αžŸαžšβ€‹αžŠαŸ†αž”αžΌαž„β€‹αž“αŸ…β€‹αž€αŸ’αž“αž»αž„β€‹αž’αžαŸ’αžαž”αž‘β€‹αžαŸ’αžšαžΌαžœβ€‹αžŸαŸ’αžšαž„αŸ‹αž…αŸαž‰Β αŸ”

Number_bytes specifies the number of characters MIDB will return from text, in bytes.

αž§αž‘αžΆαž αžšαžŽαŸ

=MIDB("δΈ­ε›½";1;0) returns "" (0 bytes is always an empty string).

=MIDB("δΈ­ε›½";1;1) returns " " (1 byte is only half a DBCS character and therefore the result is a space character).

=MIDB("δΈ­ε›½";1;2) returns "δΈ­" (2 bytes constitute one complete DBCS character).

=MIDB("δΈ­ε›½";1;3) returns "δΈ­ " (3 bytes constitute one and a half DBCS character; the last byte results in a space character).

=MIDB("δΈ­ε›½";1;4) returns "δΈ­ε›½" (4 bytes constitute two complete DBCS characters).

=MIDB("δΈ­ε›½";2;1) returns " " (byte position 2 is not at the beginning of a character in a DBCS string; 1 space character is returned).

=MIDB("δΈ­ε›½";2;2) returns " " (byte position 2 points to the last half of the first character in the DBCS string; the 2 bytes asked for therefore constitutes the last half of the first character and the first half of the second character in the string; 2 space characters are therefore returned).

=MIDB("δΈ­ε›½";2;3) returns " ε›½" (byte position 2 is not at the beginning of a character in a DBCS string; a space character is returned for byte position 2).

=MIDB("δΈ­ε›½";3;1) returns " " (byte position 3 is at the beginning of a character in a DBCS string, but 1 byte is only half a DBCS character and a space character is therefore returned instead).

=MIDB("δΈ­ε›½";3;2) returns "ε›½" (byte position 3 is at the beginning of a character in a DBCS string, and 2 bytes constitute one DBCS character).

=MIDB("office";2;3) returns "ffi" (byte position 2 is at the beginning of a character in a non-DBCS string, and 3 bytes of a non-DBCS string constitute 3 characters).

Please support us!