الفرق بين المراجعتين ل"Kotlin/kotlin.text/toMutableList"

من موسوعة حسوب
اذهب إلى التنقل اذهب إلى البحث
(أنشأ الصفحة ب'<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/List|لائحة]] تحتوي كل حروف [[Kotlin/CharSequence/index|سلسلة الحروف]]  التي استٌدعيت عبرها.
+
تعيد الدالة <code>toMutableList()</code>‎ [[Kotlin/MutableList|لائحة متغيرة]] تحتوي كل حروف [[Kotlin/CharSequence/index|سلسلة الحروف]]  التي استٌدعيت عبرها.
 
==البنية العامة==
 
==البنية العامة==
 
<syntaxhighlight lang="kotlin">
 
<syntaxhighlight lang="kotlin">
fun CharSequence.toList(): List<Char>  
+
fun CharSequence.toMutableList(): MutableList<Char>
 
 
 
</syntaxhighlight>
 
</syntaxhighlight>
 
==القيم المعادة==
 
==القيم المعادة==
[[Kotlin/List|لائحة]] من الحروف.
+
[[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!".toList()) // [H, e, l, l, o, ,,  , w, o, r, l, d, !]
+
     println("Hello, world!".toMutableList()) // [H, e, l, l, o, ,,  , w, o, r, l, d, !]
     println("Hsoub".toList()) // [H, s, o, u, b]
+
     println("Hsoub".toMutableList()) // [H, s, o, u, b]
     println("114".toList()) // [1, 1, 4]
+
     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).
  • isDefined(): تعيد القيمة true في حال كان الحرف (Unicode code point) الذي استٌدعيت عبره مُعرّفًا في اليونيكود (Unicode).

مصادر