خاصیت Length شیء String در TypeScript
خاصیت Length در زبان برنامه نویسی تایپ اسکریپت به منظور گرفتن طول یک رشته استفاده می شود.
مثال:
1 2 3 | var uname = new String("Hello World"); console.log(uname); console.log("Length " + uname.length); // returns the total number of characters including whitespace |
کد کامپایل شده معادل کد فوق خواهد بود. خروجی:
1 2 | Hello World Length 11 |
هیچ نظری ثبت نشده است