diff options
| author | Isa(yunjongryu) <yunjonglyu@gmail.com> | 2021-07-29 10:02:59 +0900 |
|---|---|---|
| committer | Kyle <mkitigy@gmail.com> | 2021-08-02 23:59:12 +0900 |
| commit | 6f3d7ff69bf779389db1ec44200ccc7af5454862 (patch) | |
| tree | 4cd6825c64dd43c003e85bce58e64e40251db447 /files/ko/web/javascript/reference/global_objects/string/trim/index.html | |
| parent | 7862cd33a40929bd29f100e331c4df124922a559 (diff) | |
| download | translated-content-6f3d7ff69bf779389db1ec44200ccc7af5454862.tar.gz translated-content-6f3d7ff69bf779389db1ec44200ccc7af5454862.tar.bz2 translated-content-6f3d7ff69bf779389db1ec44200ccc7af5454862.zip | |
etc: 깃 이력추적을 위한 절차
Diffstat (limited to 'files/ko/web/javascript/reference/global_objects/string/trim/index.html')
| -rw-r--r-- | files/ko/web/javascript/reference/global_objects/string/trim/index.html | 95 |
1 files changed, 0 insertions, 95 deletions
diff --git a/files/ko/web/javascript/reference/global_objects/string/trim/index.html b/files/ko/web/javascript/reference/global_objects/string/trim/index.html deleted file mode 100644 index 32c3607a1f..0000000000 --- a/files/ko/web/javascript/reference/global_objects/string/trim/index.html +++ /dev/null @@ -1,95 +0,0 @@ ---- -title: String.prototype.trim() -slug: Web/JavaScript/Reference/Global_Objects/String/Trim -tags: - - ECMAScript 5 - - JavaScript - - Method - - Prototype - - Reference - - String -translation_of: Web/JavaScript/Reference/Global_Objects/String/Trim ---- -<div>{{JSRef}}</div> - -<p><strong><code>trim()</code></strong> 메서드는 문자열 양 끝의 공백을 제거합니다. 공백이란 모든 공백문자(space, tab, NBSP 등)와 모든 개행문자(LF, CR 등)를 의미합니다.</p> - -<div>{{EmbedInteractiveExample("pages/js/string-trim.html")}}</div> - - - -<h2 id="구문">구문</h2> - -<pre class="syntaxbox"><var>str</var>.trim()</pre> - -<h3 id="반환_값">반환 값</h3> - -<p>양 끝에서 공백을 제거한 새로운 문자열.</p> - -<h2 id="설명">설명</h2> - -<p><code>trim()</code> 메서드는 양끝의 공백을 제거한 문자열을 반환합니다. <code>trim()</code>은 원본 문자열에는 영향을 주지 않습니다. </p> - -<h2 id="예제">예제</h2> - -<h3 id="trim()_사용"><code>trim()</code> 사용</h3> - -<p>아래의 예제는 소문자 문자열 <code>'foo'</code>를 표시합니다.</p> - -<pre class="brush: js">var orig = ' foo '; -console.log(orig.trim()); // 'foo' - -// 한 쪽의 공백만 제거하는 .trim() 예제 - -var orig = 'foo '; -console.log(orig.trim()); // 'foo' -</pre> - -<h2 id="폴리필">폴리필</h2> - -<p>다른 코드 전에 아래 코드를 실행하면 지원하지 않는 환경에서도 <code>String.trim()</code> 을 사용할 수 있습니다.</p> - -<pre class="brush: js">if (!String.prototype.trim) { - String.prototype.trim = function () { - return this.replace(/^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g, ''); - }; -} -</pre> - -<h2 id="명세">명세</h2> - -<table class="standard-table"> - <tbody> - <tr> - <th scope="col">표준</th> - <th scope="col">상태</th> - <th scope="col">비고</th> - </tr> - <tr> - <td>{{SpecName('ES5.1', '#sec-15.5.4.20', 'String.prototype.trim')}}</td> - <td>{{Spec2('ES5.1')}}</td> - <td>Initial definition. Implemented in JavaScript 1.8.1.</td> - </tr> - <tr> - <td>{{SpecName('ES6', '#sec-string.prototype.trim', 'String.prototype.trim')}}</td> - <td>{{Spec2('ES6')}}</td> - <td> </td> - </tr> - <tr> - <td>{{SpecName('ESDraft', '#sec-string.prototype.trim', 'String.prototype.trim')}}</td> - <td>{{Spec2('ESDraft')}}</td> - <td> </td> - </tr> - </tbody> -</table> - -<h2 id="브라우저_호환성">브라우저 호환성</h2> - -<p>{{Compat("javascript.builtins.String.trim")}}</p> - -<h2 id="참조">참조</h2> - -<ul> - <li>{{jsxref("String.prototype.trimLeft()")}} {{non-standard_inline}}</li> - <li>{{jsxref("String.prototype.trimRight()")}} {{non-standard_inline}}</li> -</ul> |
