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