13 lines
470 B
Markdown
13 lines
470 B
Markdown
|
---
|
||
|
title: Find the Length of a String
|
||
|
localeTitle: العثور على طول سلسلة
|
||
|
---
|
||
|
## العثور على طول سلسلة
|
||
|
|
||
|
السلاسل لها **سمة** (سمة) تسمى "length". كل ما عليك فعله هو وضع علامة عليه بعد السلسلة / المتغير.
|
||
|
|
||
|
`var str1 = "Hello";
|
||
|
var length1 = str1.length; // This returns 5
|
||
|
|
||
|
var length2 = " Camper".length; // This returns 7 because the space is counted as one character.
|
||
|
`
|