From de5c456ebded0e038adbf23db34cc290c8829180 Mon Sep 17 00:00:00 2001 From: Florian Merz Date: Thu, 11 Feb 2021 14:49:24 +0100 Subject: unslug pl: move --- .../referencje/obiekty/string/anchor/index.html | 56 ------ .../referencje/obiekty/string/big/index.html | 43 ---- .../referencje/obiekty/string/blink/index.html | 50 ----- .../referencje/obiekty/string/bold/index.html | 45 ----- .../referencje/obiekty/string/charat/index.html | 68 ------- .../obiekty/string/charcodeat/index.html | 42 ---- .../referencje/obiekty/string/concat/index.html | 44 ---- .../referencje/obiekty/string/fontcolor/index.html | 50 ----- .../referencje/obiekty/string/fontsize/index.html | 48 ----- .../obiekty/string/fromcharcode/index.html | 50 ----- .../obiekty/string/fromcodepoint/index.html | 149 -------------- .../referencje/obiekty/string/index.html | 194 ------------------ .../referencje/obiekty/string/italics/index.html | 45 ----- .../referencje/obiekty/string/link/index.html | 43 ---- .../referencje/obiekty/string/prototype/index.html | 221 --------------------- .../referencje/obiekty/string/repeat/index.html | 166 ---------------- .../referencje/obiekty/string/search/index.html | 49 ----- .../referencje/obiekty/string/slice/index.html | 51 ----- .../referencje/obiekty/string/small/index.html | 37 ---- .../referencje/obiekty/string/strike/index.html | 44 ---- .../referencje/obiekty/string/sub/index.html | 44 ---- .../referencje/obiekty/string/substr/index.html | 66 ------ .../referencje/obiekty/string/substring/index.html | 90 --------- .../referencje/obiekty/string/sup/index.html | 45 ----- .../obiekty/string/tolowercase/index.html | 40 ---- .../referencje/obiekty/string/tosource/index.html | 41 ---- .../referencje/obiekty/string/tostring/index.html | 41 ---- .../obiekty/string/touppercase/index.html | 38 ---- .../referencje/obiekty/string/valueof/index.html | 40 ---- 29 files changed, 1940 deletions(-) delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/anchor/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/big/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/blink/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/bold/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/charat/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/charcodeat/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/concat/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/fontcolor/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/fontsize/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/fromcharcode/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/fromcodepoint/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/italics/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/link/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/prototype/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/repeat/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/search/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/slice/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/small/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/strike/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/sub/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/substr/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/substring/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/sup/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/tolowercase/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/tosource/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/tostring/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/touppercase/index.html delete mode 100644 files/pl/web/javascript/referencje/obiekty/string/valueof/index.html (limited to 'files/pl/web/javascript/referencje/obiekty/string') diff --git a/files/pl/web/javascript/referencje/obiekty/string/anchor/index.html b/files/pl/web/javascript/referencje/obiekty/string/anchor/index.html deleted file mode 100644 index 737c385889..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/anchor/index.html +++ /dev/null @@ -1,56 +0,0 @@ ---- -title: String.prototype.anchor() -slug: Web/JavaScript/Referencje/Obiekty/String/anchor -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/anchor ---- -

{{JSRef}}

- -

Podsumowanie

- -

Tworzy kotwicę HTML {{HTMLElement("a")}} do użycia jako cel odnośnika.

- -

Składnia

- -
str.anchor(name)
- -

Parametry

- -
-
name
-
Łańcuch znaków.
-
- -

Opis

- -

Use the anchor() method to programmatically create and display an anchor in a document.

- -

W składni łańcuch znaków reprezentuje literał tekstowy, który ma zobaczyć użytkownik. Łańcuch name reprezentuje atrybut name znacznika a.

- -

Kotwice stworzone za pomocą metody anchor stają się elementami tablicy document.anchors.

- -

Przykłady

- -

Przykład: Zastosowanie anchor()

- -

Następujący przykład wewnątrz kodu HTML elementu script:

- -
var myString = "Tabela zawartości";
-
-document.body.innerHTML = myString.anchor("contents_anchor");
-
- -

spowoduje otrzymanie na wyjściu kodu HTML:

- -
<a name="contents_anchor">Tabela zawartości</a>
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/big/index.html b/files/pl/web/javascript/referencje/obiekty/string/big/index.html deleted file mode 100644 index 62914dfa9c..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/big/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: String.prototype.big() -slug: Web/JavaScript/Referencje/Obiekty/String/big -tags: - - Deprecated - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/big ---- -
{{JSRef}} {{deprecated_header}}
- -

Podsumowanie

- -

Powoduje, iż łańcuch znaków zostanie wyświetlony jakby znajdował się wewnątrz znacznika {{HTMLElement("big")}}.

- -

Składnia

- -
str.big()
- -

Opis

- -

The big() method embeds a string in a <big> tag: "<big>str</big>".

- -

Przykłady

- -

Przykład: Zastosowanie big()

- -

Następujący przykład stosuje metodę string do zmiany rozmiaru łańcucha znaków:

- -
var worldString = "Witaj, Świecie";
-
-console.log(worldString.small());     // <small>Witaj, Świecie</small>
-console.log(worldString.big());       // <big>Witaj, Świecie</big>
-console.log(worldString.fontsize(7)); // <fontsize=7>Witaj, Świecie</fontsize>
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/blink/index.html b/files/pl/web/javascript/referencje/obiekty/string/blink/index.html deleted file mode 100644 index 056dbc3792..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/blink/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: String.prototype.blink() -slug: Web/JavaScript/Referencje/Obiekty/String/blink -tags: - - Deprecated - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/blink ---- -
{{JSRef}} {{deprecated_header}}
- -

Podsumowanie

- -

Powoduje, iż łańcuch będzie migotał tak, jakby był on wewnątrz znacznika {{HTMLElement("blink")}}.

- -
-

Warning: Blinking text is frowned upon by several accessibility standards. The <blink> element itself is non-standard and deprecated!

-
- -

Składnia

- -
str.blink()
- -

Opis

- -

The blink() method embeds a string in a <blink> tag: "<blink>str</blink>".

- -

Przykłady

- -

Przykład: Zastosowanie blink()

- -

Następujący przykład stosuje metodę string do zmiany formatowania łańcucha znaków:

- -
var worldString="Witaj, Świecie";
-
-console.log(worldString.blink());   // <blink>Witaj, Świecie</blink>
-console.log(worldString.bold());    // <bold>Witaj, Świecie</bold>
-console.log(worldString.italics()); // <i>Witaj, Świecie</i>
-console.log(worldString.strike());  // <s>Witaj, Świecie</s>
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/bold/index.html b/files/pl/web/javascript/referencje/obiekty/string/bold/index.html deleted file mode 100644 index 0708d5799e..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/bold/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: String.prototype.bold() -slug: Web/JavaScript/Referencje/Obiekty/String/bold -tags: - - Deprecated - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/bold ---- -

{{JSRef}}{{deprecated_header}}

- -

Podsumowanie

- -

Powoduje wyświetlenie łańcucha znaków jako pogrubienia, jakby był w znaczniku {{HTMLElement("b")}}.

- -

Składnia

- -
str.bold()
- -

Opis

- -

The bold() method embeds a string in a <b> tag: "<b>str</b>".

- -

Przykłady

- -

Przykład: Zastosowanie bold()

- -

Następujący przykład stosuje metodę string do zmiany rozmiaru łańcucha znaków:

- -
var worldString="Witaj, Świecie";
-
-console.log(worldString.blink());   // <blink>Witaj, Świecie</blink>
-console.log(worldString.bold());    // <bold>Witaj, Świecie</bold>
-console.log(worldString.italics()); // <i>Witaj, Świecie</i>
-console.log(worldString.strike());  // <s>Witaj, Świecie</s>
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/charat/index.html b/files/pl/web/javascript/referencje/obiekty/string/charat/index.html deleted file mode 100644 index 30ce5303c2..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/charat/index.html +++ /dev/null @@ -1,68 +0,0 @@ ---- -title: String.prototype.charAt() -slug: Web/JavaScript/Referencje/Obiekty/String/charAt -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/charAt ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca określony znak z łańcucha znaków.

- -

Składnia

- -
str.charAt(index)
- -

Parametry

- -
-
index 
-
Liczba całkowita z przedziału od 0 do liczby o 1 mniejszej od długości łańcucha.
-
- -

Opis

- -

Znaki w łańcuchu znaków są indeksowane od lewej do prawej strony. Indeksem pierwszego znaku jest 0, a indeksem ostatniego znaku w łańcuchu znaków o nazwie stringName jest stringName.length - 1. Jeśli dostarczona wartość parametru index znajduje się poza zakresem, JavaScript zwróci pusty łańcuch znaków.

- -

Przykłady

- -

Przykład: Wyświetlanie różnych znaków z określonego łańcucha znaków

- -

Poniższy przykład wyświetla różne znaki łańcucha "Brave new world":

- -
var anyString="Brave new world";
-
-console.log("Znakiem o indeksie 0   jest '" + anyString.charAt(0)   + "'");
-console.log("Znakiem o indeksie 1   jest '" + anyString.charAt(1)   + "'");
-console.log("Znakiem o indeksie 2   jest '" + anyString.charAt(2)   + "'");
-console.log("Znakiem o indeksie 3   jest '" + anyString.charAt(3)   + "'");
-console.log("Znakiem o indeksie 4   jest '" + anyString.charAt(4)   + "'");
-console.log("Znakiem o indeksie 999 jest '" + anyString.charAt(999) + "'");
-
- -

Powyższy kod wyświetli:

- -
Znakiem o indeksie 0   jest 'B'
-Znakiem o indeksie 1   jest 'r'
-Znakiem o indeksie 2   jest 'a'
-Znakiem o indeksie 3   jest 'v'
-Znakiem o indeksie 4   jest 'e'
-Znakiem o indeksie 999 jest ''
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/charcodeat/index.html b/files/pl/web/javascript/referencje/obiekty/string/charcodeat/index.html deleted file mode 100644 index 21c7822f12..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/charcodeat/index.html +++ /dev/null @@ -1,42 +0,0 @@ ---- -title: String.prototype.charCodeAt() -slug: Web/JavaScript/Referencje/Obiekty/String/charCodeAt -tags: - - JavaScript - - Method - - Prototype - - String - - Unicode -translation_of: Web/JavaScript/Reference/Global_Objects/String/charCodeAt ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca liczbę oznaczającą wartość Unicode znaku o podanym indeksie.

- -

Składnia

- -
str.charCodeAt(index)
- -

Parametry

- -
-
index 
-
Liczba całkowita z przedziału od 0 do liczby o 1 mniejszej od długości łańcucha.
-
- -

Opis

- -

Wartości Unicode mieszczą się w zakresie od 0 do 65535. Pierwsze 128 wartości Unicode jest takie same jak w zbiorze znaków ASCII. Aby dowiedzieć się więcej o Unicode, zobacz Przewodnik po języku JavaScript.

- -

Zgodność wsteczna: JavaScript 1.2 — Metoda charCodeAt zwraca liczbę wskazującą wartość ze zbioru kodowania ISO-Latin-1 znaku o podanym indeksie. Zbiór kodowania ISO-Latin-1 posiada zakres od 0 do 255. Znaki od 0 do 127 są identyczne, co te w zbiorze znaków ASCII.

- -

Przykłady

- -

Przykład: Zastosowanie charCodeAt()

- -

Następujący przykład zwróci 65, wartość A w Unicode.

- -
"ABC".charCodeAt(0); // zwróci 65
-
diff --git a/files/pl/web/javascript/referencje/obiekty/string/concat/index.html b/files/pl/web/javascript/referencje/obiekty/string/concat/index.html deleted file mode 100644 index b4361f0fd7..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/concat/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: String.prototype.concat() -slug: Web/JavaScript/Referencje/Obiekty/String/concat -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/concat ---- -

{{JSRef}}

- -

Podsumowanie

- -

Łączy tekst dwóch lub więcej łańcuchów znaków i zwraca nowy łańcuch.

- -

Składnia

- -
str.concat(string2, string3[, ..., stringN])
- -

Parametry

- -
-
string2...string - N -  
-
Łańcuchy znaków mające być dołączone do tego łańcucha.
-
- -

Opis

- -

concat() łączy tekst jednego lub więcej łańcuchów znaków i zwraca nowy łańcuch znaków. Zmiana tekstu w jednym łańcuchu znaków nie ma wpływu na drugi łańcuch.

- -

Przykłady

- -

Przykład: Zastosowanie concat()

- -

Następujący przykład łączy łańcuchy znaków w nowy łańcuch znaków.

- -
var s1="Och, ";
-var s2="jaki piękny ";
-var s3="poranek.";
-var s4=s1.concat(s2,s3); // zwraca "Och, jaki piękny poranek."
-
diff --git a/files/pl/web/javascript/referencje/obiekty/string/fontcolor/index.html b/files/pl/web/javascript/referencje/obiekty/string/fontcolor/index.html deleted file mode 100644 index 0cc7fa1ccc..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/fontcolor/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: String.prototype.fontcolor() -slug: Web/JavaScript/Referencje/Obiekty/String/fontcolor -tags: - - Deprecated - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/fontcolor ---- -
{{JSRef}} {{deprecated_header}}
- -

Podsumowanie

- -

Powoduje, iż łańcuch zostanie wyświetlony podanym kolorem tak jakby był wewnątrz znacznika {{HTMLElement("font")}}.

- -

Składnia

- -
str.fontcolor(color)
- -

Parametry

- -
-
color 
-
Łańcuch znaków wyrażający kolor jako trójka heksadecymalna RGB lub jako łańcuch znaków. Lista nazw w postaci łańcucha znaków dla kolorów jest dostępna w przewodniku po języku JavaScript 1.5.
-
- -

Opis

- -

Jeśli wyrażamy kolor w postaci trójki heksadecymalnej RGB, to musisz zastosować format rrggbb. Na przykład, wartość heksadecymalna koloru łososiowego składa się z red=FA, green=80 i blue=72, więc trójka RGB dla łososiowego będzie miała wartość "FA8072".

- -

Przykłady

- -

Przykład: Zastosowanie fontcolor()

- -

Następujący przykład stosuje metodę string do zmiany koloru łańcucha znaków:

- -
var worldString="Witaj, Świecie";
-
-console.log(worldString.fontcolor("red") + " jest koloru czerwonego w tej linii");
-// <font color="red">Witaj, Świecie</font> jest koloru czerwonego w tej linii
-
-console.log(worldString.fontcolor("FF00") +" linia jest czerwona i podany kolor heksadecymalny");
-// <font color="FF00">Witaj, Świecie</font> linia jest czerwona i podany kolor heksadecymalny
-
- -
 
- -

 

diff --git a/files/pl/web/javascript/referencje/obiekty/string/fontsize/index.html b/files/pl/web/javascript/referencje/obiekty/string/fontsize/index.html deleted file mode 100644 index 3de3c5bb4c..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/fontsize/index.html +++ /dev/null @@ -1,48 +0,0 @@ ---- -title: String.prototype.fontsize() -slug: Web/JavaScript/Referencje/Obiekty/String/fontsize -tags: - - Deprecated - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/fontsize ---- -

{{JSRef}}{{ Non-standard_header() }}

- -

Podsumowanie

- -

Powoduje wyświetlenie łańcucha znaków w określonym rozmiarze czcionki, tak jak to było w znaczniku {{HTMLElement("font")}}.

- -

Składnia

- -
str.fontsize(size)
- -

Parametry

- -
-
size 
-
Liczba całkowita pomiędzy 1 a 7, łańcuch znaków reprezentujący rozmiar znaku liczby całkowitej między 1 a 7.
-
- -

Opis

- -

Kiedy określisz rozmiar jako liczbę całkowitą, ustaw rozmiar stringName na jeden z 7 innych rozmiarów. Kiedy określisz size łańcucha znaków jako "-2", to dostosujesz rozmiar czcionki stringName relatywnie do rozmiaru jaki został ustawiony w znaczniku {{HTMLElement("basefont")}}.

- -

Przykłady

- -

Przykład: Zastosowanie fontsize()

- -
var worldString = "Witaj, Świecie";
-
-console.log(worldString.small());     // <small>Witaj, Świecie</small>
-console.log(worldString.big());       // <big>Witaj, Świecie</big>
-console.log(worldString.fontsize(7)); // <fontsize=7>Witaj, Świecie</fontsize>
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/fromcharcode/index.html b/files/pl/web/javascript/referencje/obiekty/string/fromcharcode/index.html deleted file mode 100644 index 7d00613db2..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/fromcharcode/index.html +++ /dev/null @@ -1,50 +0,0 @@ ---- -title: String.fromCharCode() -slug: Web/JavaScript/Referencje/Obiekty/String/fromCharCode -tags: - - JavaScript - - Method - - String - - Unicode -translation_of: Web/JavaScript/Reference/Global_Objects/String/fromCharCode ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca łańcuch znaków stworzony przez podaną sekwencję kodów Unicode.

- -

Składnia

- -
String.fromCharCode(num1[, ...[, numN]])
- -

Parametry

- -
-
num1, ..., numN  
-
Sekwencja liczb, które są wartościami Unicode.
-
- -

Opis

- -

Ta metoda zwraca łańcuch znaków nie będący {{jsxref("String")}}.

- -

Ponieważ fromCharCode() jest metodą statyczną {{jsxref("String")}}, używaj ją zawsze jako String.fromCharCode(), a nie jako metodę obiektu {{jsxref("String")}}.

- -

Przykłady

- -

Przykład: Zastosowanie fromCharCode()

- -

Następujący przykład zwraca łańcuch znaków "ABC".

- -
String.fromCharCode(65,66,67); // "ABC"
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/fromcodepoint/index.html b/files/pl/web/javascript/referencje/obiekty/string/fromcodepoint/index.html deleted file mode 100644 index a8c17af7f1..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/fromcodepoint/index.html +++ /dev/null @@ -1,149 +0,0 @@ ---- -title: String.fromCodePoint() -slug: Web/JavaScript/Referencje/Obiekty/String/fromCodePoint -translation_of: Web/JavaScript/Reference/Global_Objects/String/fromCodePoint ---- -
{{JSRef}}
- -

The static String.fromCodePoint() method returns a string created by using the specified sequence of code points.

- -
{{EmbedInteractiveExample("pages/js/string-fromcodepoint.html","shorter")}}
- - - -

Syntax

- -
String.fromCodePoint(num1[, ...[, numN]])
- -

Parameters

- -
-
num1, ..., numN
-
A sequence of code points.
-
- -

Return value

- -

A string created by using the specified sequence of code points.

- -

Exceptions

- - - -

Description

- -

This method returns a string (and not a {{jsxref("String")}} object).

- -

Because fromCodePoint() is a static method of {{jsxref("String")}}, you must call it as String.fromCodePoint(), rather than as a method of a {{jsxref("String")}} object you created.

- -

Polyfill

- -

The String.fromCodePoint() method has been added to ECMAScript 2015 and may not be supported in all web browsers or environments yet.

- -

Use the code below for a polyfill:

- -
if (!String.fromCodePoint) (function(stringFromCharCode) {
-    var fromCodePoint = function(_) {
-      var codeUnits = [], codeLen = 0, result = "";
-      for (var index=0, len = arguments.length; index !== len; ++index) {
-        var codePoint = +arguments[index];
-        // correctly handles all cases including `NaN`, `-Infinity`, `+Infinity`
-        // The surrounding `!(...)` is required to correctly handle `NaN` cases
-        // The (codePoint>>>0) === codePoint clause handles decimals and negatives
-        if (!(codePoint < 0x10FFFF && (codePoint>>>0) === codePoint))
-          throw RangeError("Invalid code point: " + codePoint);
-        if (codePoint <= 0xFFFF) { // BMP code point
-          codeLen = codeUnits.push(codePoint);
-        } else { // Astral code point; split in surrogate halves
-          // https://mathiasbynens.be/notes/javascript-encoding#surrogate-formulae
-          codePoint -= 0x10000;
-          codeLen = codeUnits.push(
-            (codePoint >> 10) + 0xD800,  // highSurrogate
-            (codePoint % 0x400) + 0xDC00 // lowSurrogate
-          );
-        }
-        if (codeLen >= 0x3fff) {
-          result += stringFromCharCode.apply(null, codeUnits);
-          codeUnits.length = 0;
-        }
-      }
-      return result + stringFromCharCode.apply(null, codeUnits);
-    };
-    try { // IE 8 only supports `Object.defineProperty` on DOM elements
-      Object.defineProperty(String, "fromCodePoint", {
-        "value": fromCodePoint, "configurable": true, "writable": true
-      });
-    } catch(e) {
-      String.fromCodePoint = fromCodePoint;
-    }
-}(String.fromCharCode));
-
- -

Examples

- -

Using fromCodePoint()

- -

Valid input:

- -
String.fromCodePoint(42);       // "*"
-String.fromCodePoint(65, 90);   // "AZ"
-String.fromCodePoint(0x404);    // "\u0404" == "Є"
-String.fromCodePoint(0x2F804);  // "\uD87E\uDC04"
-String.fromCodePoint(194564);   // "\uD87E\uDC04"
-String.fromCodePoint(0x1D306, 0x61, 0x1D307); // "\uD834\uDF06a\uD834\uDF07"
-
- -

Invalid input:

- -
String.fromCodePoint('_');      // RangeError
-String.fromCodePoint(Infinity); // RangeError
-String.fromCodePoint(-1);       // RangeError
-String.fromCodePoint(3.14);     // RangeError
-String.fromCodePoint(3e-2);     // RangeError
-String.fromCodePoint(NaN);      // RangeError
-
- -

Compared to fromCharCode()

- -

{{jsxref("String.fromCharCode()")}} cannot return supplementary characters (i.e. code points 0x0100000x10FFFF) by specifying their code point. Instead, it requires the UTF-16 surrogate pair in order to return a supplementary character:

- -
String.fromCharCode(0xD83C, 0xDF03); // Code Point U+1F303 "Night with
-String.fromCharCode(55356, 57091);   // Stars" == "\uD83C\uDF03"
-
- -

String.fromCodePoint(), on the other hand, can return 4-byte supplementary characters, as well as the more common 2-byte BMP characters, by specifying their code point (which is equivalent to the UTF-32 code unit):

- -
String.fromCodePoint(0x1F303); // or 127747 in decimal
-
- -

Specifications

- - - - - - - - - - - - -
Specification
{{SpecName('ESDraft', '#sec-string.fromcodepoint', 'String.fromCodePoint')}}
- -

Browser compatibility

- - - -

{{Compat("javascript.builtins.String.fromCodePoint")}}

- -

See also

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/index.html b/files/pl/web/javascript/referencje/obiekty/string/index.html deleted file mode 100644 index ff27fbc81a..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/index.html +++ /dev/null @@ -1,194 +0,0 @@ ---- -title: String -slug: Web/JavaScript/Referencje/Obiekty/String -tags: - - JavaScript - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String ---- -

{{JSRef}}

- -

Podsumowanie

- -

Tworzy obiekt pozwalający działać na ciągach znaków.

- -

Składnia

- -

Literały znakowe są postaci:

- -
'string text'
-"string text"
-"中文 español English हिन्दी العربية português বাংলা русский 日本語 ਪੰਜਾਬੀ 한국어 தமிழ்"
-
- -

Beside regular, printable characters, special characters can be encoded using escape notation:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
CodeOutput
\0the NUL character
\'single quote
\"double quote
\\backslash
\nnew line
\rcarriage return
\vvertical tab
\ttab
\bbackspace
\fform feed
\uXXXXunicode codepoint
\xXXthe Latin-1 character
- -

Or, using the String global object directly:

- -
String(thing)
-new String(thing)
-
- -

Parametry

- -
-
thing
-
Dowolny łańcuch znaków.
-
- -

Opis

- -

trings are useful for holding data that can be represented in text form. Some of the most-used operations on strings are to check their {{jsxref("String.length", "length")}}, to build and concatenate them using the + and += string operators, checking for the existence or location of substrings with the {{jsxref("String.prototype.indexOf()", "indexOf()")}} method, or extracting substrings with the {{jsxref("String.prototype.substring()", "substring()")}} method.

- -

Character access

- -

There are two ways to access an individual character in a string. The first is the {{jsxref("String.prototype.charAt()", "charAt()")}} method:

- -
return 'cat'.charAt(1); // returns "a"
- -
- -

The other way (introduced in ECMAScript 5) is to treat the string as an array-like object, where individual characters correspond to a numerical index:

- -
return 'cat'[1]; // returns "a"
- -
- -

For character access using bracket notation, attempting to delete or assign a value to these properties will not succeed. The properties involved are neither writable nor configurable. (See {{jsxref("Object.defineProperty()")}} for more information.)

- -

Comparing strings

- -

C developers have the strcmp() function for comparing strings. In JavaScript, you just use the less-than and greater-than operators:

- -
var a = 'a';
-var b = 'b';
-if (a < b) { // true
-  print(a + ' is less than ' + b);
-} else if (a > b) {
-  print(a + ' is greater than ' + b);
-} else {
-  print(a + ' and ' + b + ' are equal.');
-}
- -

A similar result can be achieved using the {{jsxref("String.prototype.localeCompare()", "localeCompare()")}} method inherited by String instances.

- -

Distinction between string primitives and String objects

- -

Note that JavaScript distinguishes between String objects and primitive string values. (The same is true of {{jsxref("Global_Objects/Boolean", "Boolean")}} and {{jsxref("Global_Objects/Number", "Numbers")}}.)

- -

String literals (denoted by double or single quotes) and strings returned from String calls in a non-constructor context (i.e., without using the {{jsxref("Operators/new", "new")}} keyword) are primitive strings. JavaScript automatically converts primitives to String objects, so that it's possible to use String object methods for primitive strings. In contexts where a method is to be invoked on a primitive string or a property lookup occurs, JavaScript will automatically wrap the string primitive and call the method or perform the property lookup.

- -
var s_prim = 'foo';
-var s_obj = new String(s_prim);
-
-console.log(typeof s_prim); // Logs "string"
-console.log(typeof s_obj);  // Logs "object"
- -
- -

String primitives and String objects also give different results when using {{jsxref("Global_Objects/eval", "eval()")}}. Primitives passed to eval are treated as source code; String objects are treated as all other objects are, by returning the object. For example:

- -
var s1 = '2 + 2';             // creates a string primitive
-var s2 = new String('2 + 2'); // creates a String object
-console.log(eval(s1));        // returns the number 4
-console.log(eval(s2));        // returns the string "2 + 2"
- -

For these reasons, code may break when it encounters String objects when it expects a primitive string instead, although generally authors need not worry about the distinction.

- -

A String object can always be converted to its primitive counterpart with the {{jsxref("String.prototype.valueOf()", "valueOf()")}} method.

- -
console.log(eval(s2.valueOf())); // returns the number 4
- -
Note: For another possible approach to strings in JavaScript, please read the article about StringView — a C-like representation of strings based on typed arrays.
- -

Własności

- -
-
{{jsxref("String.prototype")}}
-
Pozwala na dodawanie własności do obiektu String.
-
- -
{{jsOverrides("Function", "Properties", "prototype")}}
- -

Metody

- -
-
{{jsxref("String.fromCharCode()")}}
-
Zwraca łańcuch znaków stworzony przez podaną sekwencję kodów Unicode.
-
{{jsxref("String.fromCodePoint()")}} {{experimental_inline}}
-
Returns a string created by using the specified sequence of code points.
-
{{jsxref("String.raw()")}} {{experimental_inline}}
-
Returns a string created from a raw template string.
-
- -
{{jsOverrides("Function", "Methods", "fromCharCode", "fromCodePoint", "raw")}}
- -

Przykłady

- -

Example: String conversion

- -

It's possible to use String as a "safer" {{jsxref("String.prototype.toString()", "toString()")}} alternative, as although it still normally calls the underlying toString(), it also works for {{jsxref("null")}} and {{jsxref("undefined")}}. For example:

- -
var outputStrings = [];
-for (var i = 0, n = inputValues.length; i < n; ++i) {
-  outputStrings.push(String(inputValues[i]));
-}
diff --git a/files/pl/web/javascript/referencje/obiekty/string/italics/index.html b/files/pl/web/javascript/referencje/obiekty/string/italics/index.html deleted file mode 100644 index 016a400805..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/italics/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: String.prototype.italics() -slug: Web/JavaScript/Referencje/Obiekty/String/italics -tags: - - Deprecated - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/italics ---- -

{{JSRef}}{{deprecated_header}}

- -

Podsumowanie

- -

Powoduje, iż łańcuch zostanie wyświetlony kursywą tak jakby był wewnątrz znacznika {{HTMLElement("i")}}.

- -

Składnia

- -
str.italics()
- -

Opis

- -

The italics() method embeds a string in an <i> tag: "<i>str</i>".

- -

Przykłady

- -

Przykład: Zastosowanie metody italics()

- -

Następujący przykład stosuje metodę string do zmiany formatowania łańcucha znakowego:

- -
var worldString="Witaj, Świecie";
-
-console.log(worldString.blink());   // <blink>Witaj, Świecie</blink>
-console.log(worldString.bold());    // <bold>Witaj, Świecie</bold>
-console.log(worldString.italics()); // <i>Witaj, Świecie</i>
-console.log(worldString.strike());  // <s>Witaj, Świecie</s>
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/link/index.html b/files/pl/web/javascript/referencje/obiekty/string/link/index.html deleted file mode 100644 index 6d8baeb078..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/link/index.html +++ /dev/null @@ -1,43 +0,0 @@ ---- -title: String.prototype.link() -slug: Web/JavaScript/Referencje/Obiekty/String/link -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/link ---- -

{{JSRef}}

- -

Podsumowanie

- -

Tworzy łącze hipertekstowe, które wywołuje inny URL.

- -

Składnia

- -
str.link(url)
- -

Parametry

- -
-
url
-
Jakikolwiek łańcuch określony w href ze znacznika a; powinien być umieszczany poprawny URL (relatywny lub absolutny).
-
- -

Opis

- -

Linki tworzymy poprzez metodę link stającą się elementami tablicy links z obiektu document. Zobacz document.links.

- -

Przykłady

- - - -

Następujący przykład wyświetla słowo "MDN" jako odnośnik hipertekstowy, poprzez który użytkownik będzie mógł przejść na stronę domową Netscape:

- -
var hotText="MDN";
-var URL="https://developer.mozilla.org/";
-
-console.log("Kliknij, aby powrócić do " + hotText.link(URL));
-// Kliknij, aby powrócić do <a href="https://developer.mozilla.org">MDN</a>
-
diff --git a/files/pl/web/javascript/referencje/obiekty/string/prototype/index.html b/files/pl/web/javascript/referencje/obiekty/string/prototype/index.html deleted file mode 100644 index 7785d0b34b..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/prototype/index.html +++ /dev/null @@ -1,221 +0,0 @@ ---- -title: String.prototype -slug: Web/JavaScript/Referencje/Obiekty/String/prototype -tags: - - JavaScript - - Property - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String -translation_of_original: Web/JavaScript/Reference/Global_Objects/String/prototype ---- -

{{JSRef}}

- -

Podsumowanie

- -

Reprezentuje prototyp obiektów danej klasy. Pozwala na dodawanie własności i metod do wszystkich instancji tej klasy.

- -
{{js_property_attributes(0, 0, 0)}}
- -

Opis

- -

Wszystkie instancje {{jsxref("Global_Objects/String", "String")}} dziedziczą z  String.prototype. Zmiany w prototypie obiektu String są propagowane do wszystkich instancji {{jsxref("Global_Objects/String", "String")}}.

- -

Własności

- -
-
String.prototype.constructor
-
Oznacza funkcję, która tworzy prototyp obiektu.
-
{{jsxref("String.prototype.length")}}
-
Odzwierciedla długość łańcucha znaków.
-
N
-
Używane celem uzyskania dostępu do znaku na pozycji N-tej gdzie  N jest dodatnią liczbą całkowitą między 0 a o jeden mniejszą od {{jsxref("String.length", "length")}}. Własności te są tylko do odczytu.
-
- -

Metody

- -

Metody niezwiązane z HTML

- -
-
{{jsxref("String.prototype.charAt()")}}
-
Zwraca znak o podanym indeksie.
-
{{jsxref("String.prototype.charCodeAt()")}}
-
Zwraca liczbę oznaczającą wartość Unicode znaku o podanym indeksie.
-
{{jsxref("String.prototype.codePointAt()")}} {{experimental_inline}}
-
Returns a non-negative integer that is the UTF-16 encoded code point value at the given position.
-
{{jsxref("String.prototype.concat()")}}
-
Łączy dwa łańcuchy znaków i zwraca nowy łańcuch.
-
{{jsxref("String.prototype.includes()")}} {{experimental_inline}}
-
Determines whether one string may be found within another string.
-
{{jsxref("String.prototype.endsWith()")}} {{experimental_inline}}
-
Determines whether a string ends with the characters of another string.
-
{{jsxref("String.prototype.indexOf()")}}
-
Zwraca indeks pierwszego wystąpienia podanego znaku w obiekcie String lub -1, gdy niczego nie znaleziono.
-
{{jsxref("String.prototype.lastIndexOf()")}}
-
Zwraca indeks ostatniego wystąpienia podanego znaku w obiekcie String lub -1, gdy niczego nie znaleziono.
-
{{jsxref("String.prototype.localeCompare()")}}
-
Returns a number indicating whether a reference string comes before or after or is the same as the given string in sort order.
-
{{jsxref("String.prototype.match()")}}
-
Używane do porównania wyrażenia regularnego z łańcuchem znaków.
-
{{jsxref("String.prototype.normalize()")}} {{experimental_inline}}
-
Returns the Unicode Normalization Form of the calling string value.
-
{{jsxref("String.prototype.quote()")}} {{obsolete_inline}}
-
Wraps the string in double quotes (""").
-
{{jsxref("String.prototype.repeat()")}} {{experimental_inline}}
-
Returns a string consisting of the elements of the object repeated the given times.
-
{{jsxref("String.prototype.replace()")}}
-
Używane do znalezienia podobieństwa pomiędzy wyrażeniem regularnym a łańcuchem znaków, a następnie do podmiany znalezionego podłańcucha nowym podłańcuchem.
-
{{jsxref("String.prototype.search()")}}
-
Uruchamia wyszukiwanie podobieństwa pomiędzy wyrażeniem regularnym a podanym łańcuchem.
-
{{jsxref("String.prototype.slice()")}}
-
Wyciąga kawałek łańcucha i zwraca nowy łańcuch.
-
{{jsxref("String.prototype.split()")}}
-
Dzieli obiekt {{jsxref("String")}} na tablicę łańcuchów poprzez dzielenie łańcucha na podłańcuchy.
-
{{jsxref("String.prototype.startsWith()")}} {{experimental_inline}}
-
Determines whether a string begins with the characters of another string.
-
{{jsxref("String.prototype.substr()")}}
-
Zwraca podłańcuch znaków z łańcucha, zaczynający się w podanym miejscu i podanej długości znaków.
-
{{jsxref("String.prototype.substring()")}}
-
Zwraca znaki w podłańcuchu pomiędzy dwoma indeksami w łańcuchu.
-
{{jsxref("String.prototype.toLocaleLowerCase()")}}
-
The characters within a string are converted to lower case while respecting the current locale. For most languages, this will return the same as {{jsxref("String.prototype.toLowerCase()", "toLowerCase()")}}.
-
{{jsxref("String.prototype.toLocaleUpperCase()")}}
-
The characters within a string are converted to upper case while respecting the current locale. For most languages, this will return the same as {{jsxref("String.prototype.toUpperCase()", "toUpperCase()")}}.
-
{{jsxref("String.prototype.toLowerCase()")}}
-
Zwraca wywołujący łańcuch skonwertowany do małych liter.
-
{{jsxref("String.prototype.toSource()")}} {{non-standard_inline}}
-
Zwraca literał obiektu reprezentujący podany obiekt; możesz użyć tej wartości do utworzenia nowego obiektu. Przesłania metodę {{jsxref("Object.prototype.toSource()")}}.
-
{{jsxref("String.prototype.toString()")}}
-
Zwraca łańcuch reprezentujący podany obiekt. Przesłania metodę {{jsxref("Object.prototype.toString()")}}.
-
{{jsxref("String.prototype.toUpperCase()")}}
-
Zwraca wywołujący łańcuch skonwertowany do wielkich liter.
-
{{jsxref("String.prototype.trim()")}}
-
Trims whitespace from the beginning and end of the string. Part of the ECMAScript 5 standard.
-
{{jsxref("String.prototype.trimLeft()")}} {{non-standard_inline}}
-
Trims whitespace from the left side of the string.
-
{{jsxref("String.prototype.trimRight()")}} {{non-standard_inline}}
-
Trims whitespace from the right side of the string.
-
{{jsxref("String.prototype.valueOf()")}}
-
Zwraca wartość prymitywną podanego obiektu. Przesłania metodę {{jsxref("Object.prototype.valueOf()")}}.
-
{{jsxref("String.prototype.@@iterator()", "String.prototype[@@iterator]()")}} {{experimental_inline}}
-
Returns a new Iterator object that iterates over the code points of a String value, returning each code point as a String value.
-
- -

Metody związane z HTML

- -

These methods are of limited use, as they provide only a subset of the available HTML tags and attributes.

- -
-
{{jsxref("String.prototype.anchor()")}}
-
{{htmlattrxref("name", "a", "<a name=\"name\">")}} (hypertext target)
-
{{jsxref("String.prototype.big()")}} {{deprecated_inline}}
-
{{HTMLElement("big")}}
-
{{jsxref("String.prototype.blink()")}} {{deprecated_inline}}
-
{{HTMLElement("blink")}}
-
{{jsxref("String.prototype.bold()")}} {{deprecated_inline}}
-
{{HTMLElement("b")}}
-
{{jsxref("String.prototype.fixed()")}} {{deprecated_inline}}
-
{{HTMLElement("tt")}}
-
{{jsxref("String.prototype.fontcolor()")}} {{deprecated_inline}}
-
{{htmlattrxref("color", "font", "<font color=\"color\">")}}
-
{{jsxref("String.prototype.fontsize()")}} {{deprecated_inline}}
-
{{htmlattrxref("size", "font", "<font size=\"size\">")}}
-
{{jsxref("String.prototype.italics()")}} {{deprecated_inline}}
-
{{HTMLElement("i")}}
-
{{jsxref("String.prototype.link()")}}
-
{{htmlattrxref("href", "a", "<a href=\"rul\">")}} (link to URL)
-
{{jsxref("String.prototype.small()")}} {{deprecated_inline}}
-
{{HTMLElement("small")}}
-
{{jsxref("String.prototype.strike()")}} {{deprecated_inline}}
-
{{HTMLElement("strike")}}
-
{{jsxref("String.prototype.sub()")}} {{deprecated_inline}}
-
{{HTMLElement("sub")}}
-
{{jsxref("String.prototype.sup()")}} {{deprecated_inline}}
-
{{HTMLElement("sup")}}
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
ECMAScript 1st Edition.StandardInitial definition.
{{SpecName('ES5.1', '#sec-15.5.3.1', 'String.prototype')}}{{Spec2('ES5.1')}} 
{{SpecName('ES6', '#sec-string.prototype', 'String.prototype')}}{{Spec2('ES6')}} 
- -

Browser compatibility

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}{{CompatVersionUnknown}}
-
- -

See also

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/repeat/index.html b/files/pl/web/javascript/referencje/obiekty/string/repeat/index.html deleted file mode 100644 index 76bf932753..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/repeat/index.html +++ /dev/null @@ -1,166 +0,0 @@ ---- -title: String.prototype.repeat() -slug: Web/JavaScript/Referencje/Obiekty/String/repeat -translation_of: Web/JavaScript/Reference/Global_Objects/String/repeat ---- -
{{JSRef}}
- -

The repeat() method constructs and returns a new string which contains the specified number of copies of the string on which it was called, concatenated together.

- -

Składnia

- -
str.repeat(count)
- -

Parametry

- -
-
count
-
An integer between 0 and +∞: [0, +∞), indicating the number of times to repeat the string in the newly-created string that is to be returned.
-
- -

Zwracana wartość

- -

A new string containing the specified number of copies of the given string.

- -

Exceptions

- - - -

Przykłady

- -
'abc'.repeat(-1);   // RangeError
-'abc'.repeat(0);    // ''
-'abc'.repeat(1);    // 'abc'
-'abc'.repeat(2);    // 'abcabc'
-'abc'.repeat(3.5);  // 'abcabcabc' (count will be converted to integer)
-'abc'.repeat(1/0);  // RangeError
-
-({ toString: () => 'abc', repeat: String.prototype.repeat }).repeat(2);
-// 'abcabc' (repeat() is a generic method)
-
- -

Polyfill

- -

This method has been added to the ECMAScript 6 specification and may not be available in all JavaScript implementations yet. However, you can polyfill String.prototype.repeat() with the following snippet:

- -
if (!String.prototype.repeat) {
-  String.prototype.repeat = function(count) {
-    'use strict';
-    if (this == null) {
-      throw new TypeError('can\'t convert ' + this + ' to object');
-    }
-    var str = '' + this;
-    count = +count;
-    if (count != count) {
-      count = 0;
-    }
-    if (count < 0) {
-      throw new RangeError('repeat count must be non-negative');
-    }
-    if (count == Infinity) {
-      throw new RangeError('repeat count must be less than infinity');
-    }
-    count = Math.floor(count);
-    if (str.length == 0 || count == 0) {
-      return '';
-    }
-    // Ensuring count is a 31-bit integer allows us to heavily optimize the
-    // main part. But anyway, most current (August 2014) browsers can't handle
-    // strings 1 << 28 chars or longer, so:
-    if (str.length * count >= 1 << 28) {
-      throw new RangeError('repeat count must not overflow maximum string size');
-    }
-    var rpt = '';
-    for (;;) {
-      if ((count & 1) == 1) {
-        rpt += str;
-      }
-      count >>>= 1;
-      if (count == 0) {
-        break;
-      }
-      str += str;
-    }
-    // Could we try:
-    // return Array(count + 1).join(this);
-    return rpt;
-  }
-}
-
- -

Specifications

- - - - - - - - - - - - - - - - - - - -
SpecificationStatusComment
{{SpecName('ES6', '#sec-string.prototype.repeat', 'String.prototype.repeat')}}{{Spec2('ES6')}}Initial definition.
{{SpecName('ESDraft', '#sec-string.prototype.repeat', 'String.prototype.repeat')}}{{Spec2('ESDraft')}} 
- -

Browser compatibility

- -
{{CompatibilityTable}}
- -
- - - - - - - - - - - - - - - - - - - -
FeatureChromeFirefox (Gecko)Internet ExplorerOperaSafari
Basic support{{CompatChrome("41")}} {{CompatGeckoDesktop("24")}}{{CompatNo}}{{CompatNo}}{{CompatSafari("9")}}
-
- -
- - - - - - - - - - - - - - - - - - - - - -
FeatureAndroidChrome for AndroidFirefox Mobile (Gecko)IE MobileOpera MobileSafari Mobile
Basic support{{CompatNo}}{{CompatChrome("36")}}{{CompatGeckoMobile("24")}}{{CompatNo}}{{CompatNo}}{{CompatNo}}
-
diff --git a/files/pl/web/javascript/referencje/obiekty/string/search/index.html b/files/pl/web/javascript/referencje/obiekty/string/search/index.html deleted file mode 100644 index 29b9d8e8fb..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/search/index.html +++ /dev/null @@ -1,49 +0,0 @@ ---- -title: String.prototype.search() -slug: Web/JavaScript/Referencje/Obiekty/String/search -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/search ---- -

{{JSRef}}

- -

Podsumowanie

- -

Wykonuje przeszukanie dla dopasowanych wyrażeń regularnych i tego obiektu {{jsxref("String")}}.

- -

Składnia

- -
str.search(regexp)
- -

Parametry

- -
-
regexp 
-
Nazwa wyrażenia regularnego. Może być to nazwa zmiennej lub literał.
-
- -

Opis

- -

Jeśli sukces, rezultat przeszukania indeksu wyrażenia regularnego wewnątrz łańcucha znaków. Inaczej zwróci -1.

- -

Kiedy chcesz wiedzieć gdzie jest znaleziony wzorzec w łańcuchu znaków zastosuj search() (podobne do wyrażenia regularnego metody {{jsxref("RegExp.prototype.test()", "test()")}}); aby uzyskać więcej informacji (lecz wolniej wykonywanie) zastosuj {{jsxref("String.prototype.match()", "match()")}} (podobne do wyrażenia regularnego metody {{jsxref("RegExp.prototype.exec()", "exec()")}} method).

- -

Przykłady

- - - -

Następujący przykład drukuje wiadomość, która zależy od sukcesu testu.

- -
function testinput(re, str){
-   var midstring;
-   if (str.search(re) != -1) {
-      midstring = " contains ";
-   } else {
-      midstring = " does not contain ";
-   }
-   console.log (str + midstring + re.source);
-}
-
diff --git a/files/pl/web/javascript/referencje/obiekty/string/slice/index.html b/files/pl/web/javascript/referencje/obiekty/string/slice/index.html deleted file mode 100644 index 4fca8a78ca..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/slice/index.html +++ /dev/null @@ -1,51 +0,0 @@ ---- -title: String.prototype.slice() -slug: Web/JavaScript/Referencje/Obiekty/String/slice -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/slice ---- -

{{JSRef}}

- -

Podsumowanie

- -

Wydobywa część łańcucha znaków i zwraca go jako nowy łańcuch znaków.

- -

Składnia

- -
str.slice(beginSlice[, endSlice])
- -

Parametry

- -
-
beginSlice 
-
Oparty na zerze początek indeksu rozpoczynający wyciąganie.
-
- -
-
endSlice 
-
Oparty na zerze początek indeksu, który kończy wyciąganie. Jeśli pominięty slice() wydobywa do końca łańcuch znaków.
-
- -

Opis

- -

slice() wyciąga tekst z jednego łańcucha znaków i zwraca nowy łańcuch znaków. Zmiany w treści jednego łańcucha znaków nie mają wpływu na drugi.

- -

slice() wyciąga tekst do endSlice lecz go nie włącza. string.slice(1,4) wyciąga drugi znak aż do czwartego (znaki o indeksach 1, 2 i 3).

- -

Jako ujemny indeks endSlice sygnalizuje przesunięcie z końca łańcucha znaków. str.slice(2,-1) wyciąga trzeci przez ostatni znak w łańcuchu znaków.

- -

Przykłady

- -

Przykład: Zastosowanie slice()

- -

Poniższy przykład używa slice do stworzenia nowego łańcucha znaków.

- -
var str1 = 'The morning is upon us.';
-var str2 = str1.slice(4,-2);
-
-console.log(str2); // OUTPUT: morning is upon u
-
diff --git a/files/pl/web/javascript/referencje/obiekty/string/small/index.html b/files/pl/web/javascript/referencje/obiekty/string/small/index.html deleted file mode 100644 index be9d33a5bb..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/small/index.html +++ /dev/null @@ -1,37 +0,0 @@ ---- -title: String.prototype.small() -slug: Web/JavaScript/Referencje/Obiekty/String/small -tags: - - JavaScript -translation_of: Web/JavaScript/Reference/Global_Objects/String/small ---- -
{{JSRef}} {{deprecated_header}}
- -

Podsumowanie

- -

Powoduje to, że łańcuch znaków będzie wyświetlany małą czcionką, jakby znajdował się wewnątrz znacznika {{HTMLElement("small")}}.

- -

Składnia

- -
str.small()
- -

Opis

- -

The small() method embeds a string in a <small> tag: "<small>str</small>".

- -

Przykłady

- -

Przykład: Zastosowanie metody small()

- -
var worldString = "Witaj, Świecie";
-
-console.log(worldString.small());     // <small>Witaj, Świecie</small>
-console.log(worldString.big());       // <big>Witaj, Świecie</big>
-console.log(worldString.fontsize(7)); // <fontsize=7>Witaj, Świecie</fontsize>
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/strike/index.html b/files/pl/web/javascript/referencje/obiekty/string/strike/index.html deleted file mode 100644 index cef74018f1..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/strike/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: String.prototype.strike() -slug: Web/JavaScript/Referencje/Obiekty/String/strike -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/strike ---- -

{{JSRef}}{{deprecated_header}}

- -

Podsumowanie

- -

Powoduje, iż łańcuch zostanie wyświetlony przekreślony, tak jakby był wewnątrz znacznika {{HTMLElement("strike")}}.

- -

Składnia

- -
str.strike()
- -

Opis

- -

The strike() method embeds a string in a <strike> tag: "<strike>str</strike>".

- -

Przykłady

- -

Przykład: Zastosowanie metody strike()

- -

Następujący przykład stosuje metodę string do zmiany formatowania łańcucha znakowego:

- -
var worldString="Witaj, Świecie";
-
-console.log(worldString.blink());   // <blink>Witaj, Świecie</blink>
-console.log(worldString.bold());    // <bold>Witaj, Świecie</bold>
-console.log(worldString.italics()); // <i>Witaj, Świecie</i>
-console.log(worldString.strike());  // <s>Witaj, Świecie</s>
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/sub/index.html b/files/pl/web/javascript/referencje/obiekty/string/sub/index.html deleted file mode 100644 index 4c36c53a39..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/sub/index.html +++ /dev/null @@ -1,44 +0,0 @@ ---- -title: String.prototype.sub() -slug: Web/JavaScript/Referencje/Obiekty/String/sub -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/sub ---- -

{{JSRef}}{{deprecated_header}}

- -

Podsumowanie

- -

Powoduje, iż łańcuch zostanie wyświetlony jako indeks dolny tak jakby był wewnątrz znacznika {{HTMLElement("sub")}}.

- -

Składnia

- -
str.sub()
- -

Opis

- -

The sub() method embeds a string in a <sub> tag: "<sub>str</sub>".

- -

Przykłady

- -

Przykład: Zastosowanie metod sub() i sup()

- -

Następujący przykład stosuje metody sub() i {{jsxref("String.prototype.sup()", "sup()")}} do formatowania łańcucha znaków:

- -
var superText="superscript";
-var subText="subscript";
-
-console.log("This is what a " + superText.sup() + " looks like.");
-// This is what a <sup>superscript</sup> looks like
-
-console.log("This is what a " + subText.sub() + " looks like.");
-// This is what a <sub>subscript</sub> looks like.
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/substr/index.html b/files/pl/web/javascript/referencje/obiekty/string/substr/index.html deleted file mode 100644 index 61487db384..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/substr/index.html +++ /dev/null @@ -1,66 +0,0 @@ ---- -title: String.prototype.substr() -slug: Web/JavaScript/Referencje/Obiekty/String/substr -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/substr ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca określoną liczbę początkowych znaków w łańcuchu znaków w określonej lokalizacji.

- -

Składnia

- -
str.substr(start[, length])
- -

Parametry

- -
-
start 
-
Lokalizacja, w której rozpoczyna się wyciąganie znaków (wartość liczbowa pomiędzy 0, a jeden znak mniej niż długość łańcucha znaków).
-
- -
-
length 
-
Liczba znaków do wyciągnięcia.
-
- -

Opis

- -

start jest indeksem znaków. Pierwszym znakiem w indeksie jest 0 i ostatnim znakiem w indeksie jest liczba o 1 mniejsza niż długość łańcucha znaków. substr() rozpoczyna wyciąganie znaków w start i ściąga liczbę length znaków.

- -

Jeśli start jest dodatnie i jest długością łańcucha znaków lub dłuższą wartością, substr() nie zwraca znaków.

- -

Jeśli start jest ujemne, substr() stosuje to jako indeks znaków z końca łańcucha znaków. Jeśli start jest ujemne i abs(start) jest większe niż długość łańcucha znaków to substr() stosuje 0 jako początek indeksu.

- -

Jeśli length jest 0 lub ujemne, substr() nie zwróci znaków. Jeśli length jest opuszczone, substr() wyciągnie znaki aż do końca łańcucha znaków.

- -

Przykłady

- -

Przykład: Zastosowanie substr()

- -

Rozpatrz poniższy skrypt:

- -
var str = 'abcdefghij';
-
-console.log('(1, 2): ' + str.substr(1, 2)); // '(1, 2): bc'
-console.log('(-3, 2): ' + str.substr(-3, 2)); // '(-3, 2): hi'
-console.log('(-3): ' + str.substr(-3)); // '(-3): hij'
-console.log('(1): ' + str.substr(1)); // '(1): bcdefghij'
-console.log('(-20, 2): ' + str.substr(-20, 2)); // '(-20, 2): ab'
-console.log('(20, 2): ' + str.substr(20, 2)); // '(20, 2): '
-
- -

Zobacz także

- -

 

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/substring/index.html b/files/pl/web/javascript/referencje/obiekty/string/substring/index.html deleted file mode 100644 index 5a446e0225..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/substring/index.html +++ /dev/null @@ -1,90 +0,0 @@ ---- -title: String.prototype.substring() -slug: Web/JavaScript/Referencje/Obiekty/String/substring -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/substring ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca podciąg obiektu String.

- -

Składnia

- -
str.substring(indexA[, indexB])
- -

Parametry

- -
-
indexA 
-
Liczba całkowita pomiędzy 0, a liczbą o jeden mniejszą niż długość łańcucha znaków.
-
indexB 
-
Opcjonalny. Liczba całkowita pomiędzy 0 i długością łańcucha znaków.
-
- -

Opis

- -

substring urywa znaki z indexA lecz nie włącza ich do indexB. W szczególności:

- - - -

Jeśli indexA jest większy niż indexB, JavaScript zwróci substring(indexB, indexA).

- -

Przykłady

- -

Przykład: Zastosowanie substring()

- -

Następujący przykład substring stosujemy do wyświetlenia znaków ze słowa "Mozilla":

- -
var anyString = "Mozilla";
-
-// Wyświetli  "Moz"
-console.log(anyString.substring(0,3));
-console.log(anyString.substring(3,0));
-
-// Wyświetli  "lla"
-console.log(anyString.substring(4));
-console.log(anyString.substring(4,7));
-console.log(anyString.substring(7,4));
-
-// Wyświetli  "Mozill"
-console.log(anyString.substring(0,6));
-
-// Wyświetli "Mozilla"
-console.log(anyString.substring(0,7));
-console.log(anyString.substring(0,10));
-
- -

Przykład: Zamiana podciągu wewnątrz ciągu

- -

Następujący przykład zamienia podciąg wewnątrz ciągu. Zostaną zamienione oba poszczególne znaki i podciągi. Funkcja zostanie wywołana na koniec przykładu zmieniając łańcuch znaków; "Brave New World" na "Brave New Web".

- -
function replaceString(oldS, newS, fullS) {
-// Replaces oldS with newS in the string fullS
-   for (var i = 0; i < fullS.length; i++) {
-      if (fullS.substring(i, i + oldS.length) == oldS) {
-         fullS = fullS.substring(0, i) + newS + fullS.substring(i + oldS.length, fullS.length);
-      }
-   }
-   return fullS;
-}
-
-replaceString("World", "Web", "Brave New World");
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/sup/index.html b/files/pl/web/javascript/referencje/obiekty/string/sup/index.html deleted file mode 100644 index dbf33ea3ed..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/sup/index.html +++ /dev/null @@ -1,45 +0,0 @@ ---- -title: String.prototype.sup() -slug: Web/JavaScript/Referencje/Obiekty/String/sup -tags: - - Deprecated - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/sup ---- -

{{JSRef}}{{deprecated_header}}

- -

Podsumowanie

- -

Powoduje, iż łańcuch zostanie wyświetlony jako indeks górny tak jakby był wewnątrz znacznika {{HTMLElement("sup")}}.

- -

Składnia

- -
str.sup()
- -

Opis

- -

The sup() method embeds a string in a <sup> tag: "<sup>str</sup>".

- -

Przykłady

- -

Przykład: Zastosowanie metody sub() i sup()

- -

Następujący przykład stosuje metodę {{jsxref("String.prototype.sub()", "sub()")}} i sup() do zmiany formatu łańcucha znaków:

- -
var superText="superscript";
-var subText="subscript";
-
-console.log("This is what a " + superText.sup() + " looks like.");
-// This is what a <sup>superscript</sup> looks like
-
-console.log("This is what a " + subText.sub() + " looks like.");
-// This is what a <sub>subscript</sub> looks like.
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/tolowercase/index.html b/files/pl/web/javascript/referencje/obiekty/string/tolowercase/index.html deleted file mode 100644 index 0b871b9ca6..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/tolowercase/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: String.prototype.toLowerCase() -slug: Web/JavaScript/Referencje/Obiekty/String/toLowerCase -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/toLowerCase ---- -

{{jsref}}

- -

Podsumowanie

- -

Zwraca wartość wywołującego łańcucha znaków, skonwertowaną na małe litery.

- -

Składnia

- -
str.toLowerCase()
- -

Opis

- -

Metoda toLowerCase() zwraca wartość łańcucha znaków skonwertowanego na małe litery. toLowerCase() nie wpływa na wartość samego łańcucha.

- -

Przykłady

- -

Przykład: Zastosowanie toLowerCase

- -

Następujący przykład wyświetli łańcuch "alfabet" złożony z małych liter:

- -
console.log('ALFABET'.toLowerCase()); // 'alfabet'
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/tosource/index.html b/files/pl/web/javascript/referencje/obiekty/string/tosource/index.html deleted file mode 100644 index cb372d673c..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/tosource/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: String.prototype.toSource() -slug: Web/JavaScript/Referencje/Obiekty/String/toSource -tags: - - JavaScript - - Method - - Non-standard - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/toSource ---- -

{{JSRef}}{{non-standard_header}}

- -

Podsumowanie

- -

Zwraca łańcuch znaków reprezentujący kod źródłowy obiektu.

- -

Składnia

- -
String.toSource()
-str.toSource()
-
- -

Opis

- -

Metoda toSource() zwraca następujące wartości:

- - - -

Ta metoda jest w JavaScript wywoływana zazwyczaj wewnętrznie, nie bezpośrednio w kodzie.

- -
 
diff --git a/files/pl/web/javascript/referencje/obiekty/string/tostring/index.html b/files/pl/web/javascript/referencje/obiekty/string/tostring/index.html deleted file mode 100644 index 16028dff15..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/tostring/index.html +++ /dev/null @@ -1,41 +0,0 @@ ---- -title: String.protype.toString() -slug: Web/JavaScript/Referencje/Obiekty/String/toString -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/toString ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca łańcuch znaków reprezentujący dany obiekt.

- -

Składnia

- -
str.toString()
- -

Opis

- -

Obiekt {{jsxref("String")}} przesłania metodę toString obiektu {{jsxref("Object")}}; nie dziedziczy {{jsxref("Object.prototype.toString()")}}. Dla obiektów {{jsxref("String")}}, metoda toString() zwraca łańcuch znaków reprezentujący obiekt.

- -

Przykłady

- -

Przykład: Zastosowanie toString()

- -

Następujący przykład wyświetli wartość łańcuch znaków obiektu {{jsxref("String")}}:

- -
var x = new String("Witaj świecie");
-
-console.log(x.toString())      // Wyświetla "Witaj świecie"
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/touppercase/index.html b/files/pl/web/javascript/referencje/obiekty/string/touppercase/index.html deleted file mode 100644 index 4b792076fe..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/touppercase/index.html +++ /dev/null @@ -1,38 +0,0 @@ ---- -title: String.prototype.toUpperCase() -slug: Web/JavaScript/Referencje/Obiekty/String/toUpperCase -tags: - - JavaScript - - Method - - Prototype - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/toUpperCase ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca wartość wywołującego łańcucha znaków, skonwertowaną na duże litery.

- -

Składnia

- -
str.toUpperCase()
- -

Opis

- -

Metoda toUpperCase() zwraca wartość łańcucha znaków skonwertowanego na duże litery. toUpperCase() nie wpływa na wartość samego łańcucha.

- -

Przykłady

- -

Przykład: Zastosowanie toUpperCase()

- -
console.log('alfabet'.toUpperCase()); // 'ALFABET'
-
- -

Zobacz także

- - diff --git a/files/pl/web/javascript/referencje/obiekty/string/valueof/index.html b/files/pl/web/javascript/referencje/obiekty/string/valueof/index.html deleted file mode 100644 index 1eda0e3021..0000000000 --- a/files/pl/web/javascript/referencje/obiekty/string/valueof/index.html +++ /dev/null @@ -1,40 +0,0 @@ ---- -title: String.prototype.valueOf() -slug: Web/JavaScript/Referencje/Obiekty/String/valueOf -tags: - - JavaScript - - Method - - Property - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/valueOf ---- -

{{JSRef}}

- -

Podsumowanie

- -

Zwraca pierwotną wartość obiektu {{jsxref("String")}}.

- -

Składnia

- -
str.valueOf()
- -

Opis

- -

Metoda valueOf() obiektu {{jsxref("String")}} zwraca pierwotną wartość obiektu {{jsxref("String")}} jako łańcuch znaków. Ta wartość jest równoważna do {{jsxref("String.prototype.toString()")}}.

- -

Ta metoda jest w JavaScript wywoływana zazwyczaj wewnętrznie, nie bezpośrednio w kodzie.

- -

Przykłady

- -

Przykład: Zastosowanie valueOf()

- -
var x = new String("Witaj świecie");
-console.log(x.valueOf()); // Wyświetla "Witaj świecie"
-
- -

Zobacz także

- - -- cgit v1.2.3-54-g00ecf