الفرق بين المراجعتين لصفحة: «Kotlin/kotlin.text/toMutableList»
< Kotlin | kotlin.text
أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: التابع text.toMutableList() في لغة Kotlin}}</noinclude> تضيف الدالة <code>toMutableList()</code> Kotlin/List|لا...' |
لا ملخص تعديل |
||
| سطر 1: | سطر 1: | ||
<noinclude>{{DISPLAYTITLE: التابع text.toMutableList() في لغة Kotlin}}</noinclude> | <noinclude>{{DISPLAYTITLE: التابع text.toMutableList() في لغة Kotlin}}</noinclude> | ||
تعيد الدالة <code>toMutableList()</code> [[Kotlin/MutableList|لائحة متغيرة]] تحتوي كل حروف [[Kotlin/CharSequence/index|سلسلة الحروف]] التي استٌدعيت عبرها. | |||
==البنية العامة== | ==البنية العامة== | ||
<syntaxhighlight lang="kotlin"> | <syntaxhighlight lang="kotlin"> | ||
fun CharSequence. | fun CharSequence.toMutableList(): MutableList<Char> | ||
</syntaxhighlight> | </syntaxhighlight> | ||
==القيم المعادة== | ==القيم المعادة== | ||
[[Kotlin/ | [[Kotlin/MutableList|لائحة متغيرة]] من الحروف. | ||
==أمثلة== | ==أمثلة== | ||
===استخدام الدالة <code>toMutableList()</code> مع السلاسل النصية=== | ===استخدام الدالة <code>toMutableList()</code> مع السلاسل النصية=== | ||
تستدعي الشيفرة الآتية الدالة <code>toMutableList()</code> عبر عدة [[Kotlin/String|سلاسل نصية]]، وتطبع الناتج:<syntaxhighlight lang="kotlin"> | تستدعي الشيفرة الآتية الدالة <code>toMutableList()</code> عبر عدة [[Kotlin/String|سلاسل نصية]]، وتطبع الناتج:<syntaxhighlight lang="kotlin"> | ||
fun main(args: Array<String>) { | fun main(args: Array<String>) { | ||
println("Hello, world!". | println("Hello, world!".toMutableList()) // [H, e, l, l, o, ,, , w, o, r, l, d, !] | ||
println("Hsoub". | println("Hsoub".toMutableList()) // [H, s, o, u, b] | ||
println("114". | println("114".toMutableList()) // [1, 1, 4] | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| سطر 28: | سطر 27: | ||
==مصادر== | ==مصادر== | ||
<span> </span> | <span> </span> | ||
*[http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-list.html صفحة الدالة text.toMutableList() في التوثيق الرسميّ للمكتبة القياسيّة في لغة Kotlin.] | *[http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-mutable-list.html صفحة الدالة text.toMutableList() في التوثيق الرسميّ للمكتبة القياسيّة في لغة Kotlin.] | ||
[[تصنيف:Kotlin]] | [[تصنيف:Kotlin]] | ||
[[تصنيف:Kotlin Method]] | [[تصنيف:Kotlin Method]] | ||
مراجعة 18:16، 13 يوليو 2018
تعيد الدالة toMutableList() لائحة متغيرة تحتوي كل حروف سلسلة الحروف التي استٌدعيت عبرها.
البنية العامة
fun CharSequence.toMutableList(): MutableList<Char>
القيم المعادة
لائحة متغيرة من الحروف.
أمثلة
استخدام الدالة toMutableList() مع السلاسل النصية
تستدعي الشيفرة الآتية الدالة toMutableList() عبر عدة سلاسل نصية، وتطبع الناتج:
fun main(args: Array<String>) {
println("Hello, world!".toMutableList()) // [H, e, l, l, o, ,, , w, o, r, l, d, !]
println("Hsoub".toMutableList()) // [H, s, o, u, b]
println("114".toMutableList()) // [1, 1, 4]
}
انظر أيضًا
toDouble() : تحلّل الدالةtoDouble() السلسلة النصية التي استٌدعيت عبرها وتحوّلها إلى عدد من النوعDoubleوتعيد الناتج.
toUpperCase() : تحوّل الدالةtoUpperCase() الحرف أو السلسلة النصية التي استٌدعيت عبرها إلى حالة الأحرف الكبيرة (uppercase).
toBigDecimalOrNull(): تحلّل الدالةtoBigDecimalOrNull() السلسلة النصية التي استٌدعيت عبرها وتحوّلها إلى عدد من النوعBigDecimal.toBigDecimal(): تحلّل الدالةtoBigDecimal() السلسلة النصية التي استٌدعيت عبرها وتحوّلها إلى عدد من النوعBigDecimal.
isDefined(): تعيد القيمةtrueفي حال كان الحرف (Unicode code point) الذي استٌدعيت عبره مُعرّفًا في اليونيكود (Unicode).
مصادر