aboutsummaryrefslogtreecommitdiff
path: root/files/ru/web/javascript/reference/global_objects/string/trimstart/index.html
blob: a5f0149a656cb602748eb66e9f6803f49f804a2b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
---
title: String.prototype.trimLeft()
slug: Web/JavaScript/Reference/Global_Objects/String/trimStart
tags:
  - JavaScript
  - Method
  - Non-standard
  - Prototype
  - Reference
  - String
translation_of: Web/JavaScript/Reference/Global_Objects/String/trimStart
original_slug: Web/JavaScript/Reference/Global_Objects/String/TrimLeft
---
<div>{{JSRef("Global_Objects", "String")}} {{non-standard_header}}</div>

<h2 id="Summary">Сводка</h2>
<p>Метод <strong><code>trimLeft()</code></strong> удаляет пробельные символы с левого конца строки.</p>

<h2 id="Syntax">Синтаксис</h2>
<pre class="syntaxbox"><code><var>str</var>.trimLeft()</code></pre>

<h2 id="Description">Описание</h2>
<p>Метод <code>trimLeft()</code> возвращает строку с вырезанными пробельными символами с её левого конца. Метод <code>trimLeft()</code> не изменяет значение самой строки.</p>

<h2 id="Examples">Примеры</h2>

<h3 id="Example:_Using_trimLeft">Пример: использование метода <code>trimLeft()</code></h3>
<p>Следующий пример покажет строку <code style="white-space: pre;">'foo  '</code>:</p>
<pre class="brush: js; highlight: [5]">var str = '   foo  ';

console.log(str.length); // 8

str = str.trimLeft();
console.log(str.length); // 5
console.log(str);        // 'foo  '
</pre>

<h2 id="Specifications">Спецификации</h2>
<p>Не является частью какого-либо стандарта. Реализована в JavaScript 1.8.1.</p>

<h2 id="Browser_compatibility">Совместимость с браузерами</h2>
<p>{{Compat}}</p>

<h2 id="See_also">Смотрите также</h2>
<ul>
 <li>{{jsxref("String.prototype.trim()")}}</li>
 <li>{{jsxref("String.prototype.trimRight()")}} {{non-standard_inline}}</li>
</ul>