From b0473042ff89f94b04e9c7ebe0cfeb5750c2cc4b Mon Sep 17 00:00:00 2001 From: Pierre F Date: Wed, 6 Nov 2024 17:17:14 +0200 Subject: tdf#143846 split LEFTB LENB MIDB RIGHTB Change-Id: I57be1c7ea1642ef84798fadc6dd204bbac4c994e Reviewed-on: https://gerrit.libreoffice.org/c/help/+/176069 Tested-by: Jenkins Reviewed-by: Olivier Hallot --- source/text/scalc/01/04060110.xhp | 118 ++--------------------------------- source/text/scalc/01/func_leftb.xhp | 41 ++++++++++++ source/text/scalc/01/func_lenb.xhp | 41 ++++++++++++ source/text/scalc/01/func_mid.xhp | 40 ++++++++++++ source/text/scalc/01/func_midb.xhp | 49 +++++++++++++++ source/text/scalc/01/func_rightb.xhp | 41 ++++++++++++ 6 files changed, 217 insertions(+), 113 deletions(-) create mode 100644 source/text/scalc/01/func_leftb.xhp create mode 100644 source/text/scalc/01/func_lenb.xhp create mode 100644 source/text/scalc/01/func_mid.xhp create mode 100644 source/text/scalc/01/func_midb.xhp create mode 100644 source/text/scalc/01/func_rightb.xhp (limited to 'source') diff --git a/source/text/scalc/01/04060110.xhp b/source/text/scalc/01/04060110.xhp index fb03ee3956..5fefe476c3 100644 --- a/source/text/scalc/01/04060110.xhp +++ b/source/text/scalc/01/04060110.xhp @@ -122,104 +122,17 @@
-
- - LEFTB function - - - - -

LEFTB

-Returns the first characters of a DBCS text. - - -LEFTB("Text" [; Number_bytes]) -Text is the text where the initial partial words are to be determined. -Number_bytes (optional) specifies the number of characters you want LEFTB to extract, based on bytes. If this parameter is not defined, one character is returned. - - -=LEFTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead). -=LEFTB("中国";2) returns "中" (2 bytes constitute one complete DBCS character). -=LEFTB("中国";3) returns "中 " (3 bytes constitute one DBCS character and a half; the last character returned is therefore a space character). -=LEFTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters). -=LEFTB("office";3) returns "off" (3 non-DBCS characters each consisting of 1 byte). -
+
-
- - LENB function - - - - -

LENB

-For double-byte character set (DBCS) languages, returns the number of bytes used to represent the characters in a text string. - - -LENB("Text") -Text is the text whose length is to be determined. - - -LENB("中") returns 2 (1 DBCS character consisting of 2 bytes). -LENB("中国") returns 4 (2 DBCS characters each consisting of 2 bytes). -LENB("office") returns 6 (6 non-DBCS characters each consisting of 1 byte). - =LENB("Good Afternoon") returns 14. - =LENB(12345.67) returns 8. -
+
-
- - MID function - - - - -

MID

-Returns a text string of a text. The parameters specify the starting position and the number of characters. +
- -MID("Text"; Start; Number) - Text is the text containing the characters to extract. - Start is the position of the first character in the text to extract. - Number specifies the number of characters in the part of the text. - - - =MID("office";2;2) returns ff. -
- -
- - MIDB function - - - - -

MIDB

-Returns a text string of a DBCS text. The parameters specify the starting position and the number of characters. - - -MIDB("Text"; Start; Number_bytes) -Text is the text containing the characters to extract. -Start is the position of the first character in the text to extract. -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). -
+
@@ -233,28 +146,7 @@ -
- - RIGHTB function - - - - -

RIGHTB

-Returns the last character or characters of a text with double bytes characters sets (DBCS). - - -RIGHTB("Text" [; Number_bytes]) -Text is the text of which the right part is to be determined. -Number_bytes (optional) specifies the number of characters you want RIGHTB to extract, based on bytes. If this parameter is not defined, one byte is returned. - - -RIGHTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead). -RIGHTB("中国";2) returns "国" (2 bytes constitute one complete DBCS character). -RIGHTB("中国";3) returns " 国" (3 bytes constitute one half DBCS character and one whole DBCS character; a space is returned for the first half). -RIGHTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters). -RIGHTB("office";3) returns "ice" (3 non-DBCS characters each consisting of 1 byte). -
+
diff --git a/source/text/scalc/01/func_leftb.xhp b/source/text/scalc/01/func_leftb.xhp new file mode 100644 index 0000000000..674d15752a --- /dev/null +++ b/source/text/scalc/01/func_leftb.xhp @@ -0,0 +1,41 @@ + + + + + + LEFTB Function + /text/scalc/01/func_leftb.xhp + + + + + + LEFTB function + + + +
+

LEFTB

+Returns the first characters of a DBCS text. +
+ + +LEFTB("Text" [; Number_bytes]) +Text is the text where the initial partial words are to be determined. +Number_bytes (optional) specifies the number of characters you want LEFTB to extract, based on bytes. If this parameter is not defined, one character is returned. + + +=LEFTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead). +=LEFTB("中国";2) returns "中" (2 bytes constitute one complete DBCS character). +=LEFTB("中国";3) returns "中 " (3 bytes constitute one DBCS character and a half; the last character returned is therefore a space character). +=LEFTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters). +=LEFTB("office";3) returns "off" (3 non-DBCS characters each consisting of 1 byte). + +
diff --git a/source/text/scalc/01/func_lenb.xhp b/source/text/scalc/01/func_lenb.xhp new file mode 100644 index 0000000000..ebf0a71c84 --- /dev/null +++ b/source/text/scalc/01/func_lenb.xhp @@ -0,0 +1,41 @@ + + + + + + LENB Function + /text/scalc/01/func_lenb.xhp + + + + + + LENB function + + + + +
+

LENB

+For double-byte character set (DBCS) languages, returns the number of bytes used to represent the characters in a text string. +
+ + +LENB("Text") +Text is the text whose length is to be determined. + + +LENB("中") returns 2 (1 DBCS character consisting of 2 bytes). +LENB("中国") returns 4 (2 DBCS characters each consisting of 2 bytes). +LENB("office") returns 6 (6 non-DBCS characters each consisting of 1 byte). + =LENB("Good Afternoon") returns 14. + =LENB(12345.67) returns 8. + +
diff --git a/source/text/scalc/01/func_mid.xhp b/source/text/scalc/01/func_mid.xhp new file mode 100644 index 0000000000..b70c6e0981 --- /dev/null +++ b/source/text/scalc/01/func_mid.xhp @@ -0,0 +1,40 @@ + + + + + + MID Function + /text/scalc/01/func_mid.xhp + + + + + MID function + + +
+

+ + MID + +

+ + Returns a text string of a text. The parameters specify the starting position and the number of characters. + +
+ + MID("Text"; Start; Number) + Text is the text containing the characters to extract. + Start is the position of the first character in the text to extract. + Number specifies the number of characters in the part of the text. + + =MID("office";2;2) returns ff. + +
diff --git a/source/text/scalc/01/func_midb.xhp b/source/text/scalc/01/func_midb.xhp new file mode 100644 index 0000000000..0e9b97ff9b --- /dev/null +++ b/source/text/scalc/01/func_midb.xhp @@ -0,0 +1,49 @@ + + + + + + MIDB Function + /text/scalc/01/func_midb.xhp + + + + + + MIDB function + + + + +
+

MIDB

+Returns a text string of a DBCS text. The parameters specify the starting position and the number of characters. +
+ + +MIDB("Text"; Start; Number_bytes) +Text is the text containing the characters to extract. +Start is the position of the first character in the text to extract. +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). + +
diff --git a/source/text/scalc/01/func_rightb.xhp b/source/text/scalc/01/func_rightb.xhp new file mode 100644 index 0000000000..b297ce50bd --- /dev/null +++ b/source/text/scalc/01/func_rightb.xhp @@ -0,0 +1,41 @@ + + + + + + RIGHTB Function + /text/scalc/01/func_rightb.xhp + + + + + + RIGHTB function + + + +
+

RIGHTB

+Returns the last character or characters of a text with double bytes characters sets (DBCS). +
+ + +RIGHTB("Text" [; Number_bytes]) +Text is the text of which the right part is to be determined. +Number_bytes (optional) specifies the number of characters you want RIGHTB to extract, based on bytes. If this parameter is not defined, one byte is returned. + + +RIGHTB("中国";1) returns " " (1 byte is only half a DBCS character and a space character is returned instead). +RIGHTB("中国";2) returns "国" (2 bytes constitute one complete DBCS character). +RIGHTB("中国";3) returns " 国" (3 bytes constitute one half DBCS character and one whole DBCS character; a space is returned for the first half). +RIGHTB("中国";4) returns "中国" (4 bytes constitute two complete DBCS characters). +RIGHTB("office";3) returns "ice" (3 non-DBCS characters each consisting of 1 byte). + +
-- cgit