"함수 str repeat()"의 두 판 사이의 차이

잔글 (Jmnote님이 Str repeat 문서를 함수 str repeat() 문서로 이동했습니다)
(차이 없음)

2018년 7월 13일 (금) 09:29 판

str_repeat

1 JavaScript

String.prototype.repeat=function(n){return new Array(n+1).join(this)}
console.log( "hello".repeat(3) );
// hellohellohello

2 PHP

echo str_repeat("hello", 3);
// hellohellohello

3 Python

print "hello" * 3
# hellohellohello

4 같이 보기

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}