LibreOfficeDev 25.2 žinynas
Šioje sekcijoje galite rasti Tekstinių funkcijų aprašymus.
To include a text string in a formula, place the text string between two double quotation marks (") and Calc takes the characters in the string without attempting to interpret them. For example, the formula ="Hello world!" displays the text string Hello world! in the cell, with no surrounding double quotation marks.
The more complex formula =CONCATENATE("Life is really simple, "; "but we insist on making it complicated "; "(Confucius).") concatenates three individual strings in double quotation marks, outputting Life is really simple, but we insist on making it complicated (Confucius).
To place a literal double quotation mark within a string inside a formula, two methods can be used:
You can "escape" the double quotation mark with an additional double quotation mark, and Calc treats the escaped double quotation mark as a literal value. For example, the formula ="My name is ""John Doe""." outputs the string My name is "John Doe". Another simple example is the formula =UNICODE("""") which returns 34, the decimal value of the Unicode quotation mark character (U+0022) — here the first and fourth double quotation marks indicate the beginning and end of the string, while the second double quotation mark escapes the third.
You can use the CHAR function or the UNICHAR function to insert a double quotation mark. For example, the formula =UNICHAR(34) & "The Catcher in the Rye" & UNICHAR(34) & " is a famous book by J. D. Salinger." displays the string "The Catcher in the Rye" is a famous book by J. D. Salinger.
Be aware that Calc's AutoCorrect function may modify double quotation marks. AutoCorrect should not change the double quotation marks within formula cells but may change those used in non-formula cells containing text. For example, if you copy a string that is surrounded by some other form of typographical double quotation marks, such as the left double quotation mark (U+201C) and the right double quotation mark (U+201D), and then paste into a formula cell, an error may result. Open the Double Quotes area of the dialog to set the characters used to automatically correct the start and end typographical double quotation marks. Uncheck the toggle button to disable the feature.
Cells with the empty string ("") are not equivalent to blank cells. When searching or calculating with text, the empty string "" is the text with length zero.
For example, when the formula in A1 returns the empty string "", the following applies:
=ISBLANK(A1) returns FALSE. The cell is not blank.
=ISFORMULA(A1) returns TRUE. The cell is a formula.
=ISLOGICAL(A1) returns FALSE. Not a logical value.
=ISNONTEXT(A1) returns FALSE. The cell has the empty string.
=ISNUMBER(A1) returns FALSE. Not a number.
=ISTEXT(A1) returns TRUE. The cell has the empty string, calculated by a formula.
=LEN(A1) returns 0. The length of the empty string is 0.
Grąžina pirmą DBCS teksto ženklą.
LEFTB("tekstas" [; baitų skaičius])
Tekstas – tekstas, kuriame reikia nustatyti nepilną žodį.
Baitai (papildomas) – nurodomas ženklų, kuriuos norite ištraukti, skaičius baitais. Jei šis parametras nenurodytas, funkcija grąžina vieną ženklą.
=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).
Funkcija skirta dviejų baitų kalboms (DBCS). Grąžina eilutės ilgį baitais.
LENB("tekstas")
Tekstas – tekstas, kurio ilgis skaičiuojamas.
=LENB("中") grąžina 2 (1 DBCS ženklas užima 2 baitus).
=LENB("中国") grąžina 4 (1 DBCS ženklas užima 2 baitus).
=LENTB("perėja") grąžina 6 (kiekvienas kalbos ženklas užima vieną baitą).
=LENB("Labas vakaras") grąžina 13.
=LENB(12345.67) grąžina 8.
Grąžina teksto eilutę. Parametras nurodo, nuo kurios eilutės vietos pradedamas konvertavimas.
MID("tekstas"; pradžia; skaičius)
Tekstas – teksto eilutė, kuri ar kurios dalis konvertuojama.
Pradžia – pirmojo ženklo, nuo kurio pradedamas konvertavimas, vieta.
Skaičius – ženklų, kurie bus konvertuojami, skaičius.
=MID("mėnulis";2;2) grąžina „ėn“
Grąžina DBCS teksto eilutę. Parametras nurodo, nuo kurios eilutės vietos pradedamas konvertavimas ir kiek ženklų bus konvertuojama.
MIDB("tekstas"; pradžia; baitai)
Tekstas – teksto eilutė, kuri ar kurios dalis konvertuojama.
Pradžia – pirmojo ženklo, nuo kurio pradedamas konvertavimas, vieta.
Baitai – nurodomas grąžinamas ženklų skaičius baitais.
=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).
Grąžina nurodytą baitų skaičių DBCS ženklų eilutės dešinės dalies paskutinių ženklų.
RIGHTB("tekstas" [; baitų skaičius])
Tekstas – tekstas, kurios dešinioji pusė bus grąžinta.
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) grąžina „ “ (nurodyta grąžinti pusę DBCS ženklo, todėl grąžinamas tarpo ženklas).
=RIGHTB("中国";2) grąžina „国“ (2 baitai apima vieną DBCS ženklą).
=IGHTB("中国";3) grąžina „ 国“ (3 baitai apima pusantro DBCS ženklo, todėl grąžinamas tarpas vienas ženklas).
=RIGHTB("中国";4) grąžina „中国“ (4 baitai apima du DBCS ženklus).
=RIGHTB("perėja";3) grąžina "per" (kiekvienas ženklas užima vieną baitą).