الفرق بين المراجعتين ل"Kotlin/kotlin.text/toSortedSet"
< Kotlin | kotlin.text
اذهب إلى التنقل
اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: التابع text.toSortedSet() في لغة Kotlin}}</noinclude> تعيد الدالة <code>toSortedSet()</code> Kotlin/Set|مجمو...') |
جميل-بيلوني (نقاش | مساهمات) ط |
||
(مراجعتان متوسطتان بواسطة مستخدمين اثنين آخرين غير معروضتين) | |||
سطر 1: | سطر 1: | ||
− | <noinclude>{{DISPLAYTITLE: | + | <noinclude>{{DISPLAYTITLE:الدالة <code>toSortedSet()</code> في Kotlin}}</noinclude> |
− | + | تضيف الدالة <code>toSortedSet()</code> كل محارف [[Kotlin/CharSequence|السلسلة]] التي استٌدعيت معها إلى مجموعة من النوع <code>[[Kotlin/collections/SortedSet|SortedSet]]</code>، إذ يوضع كل محرف في عنصر. | |
− | |||
− | |||
==البنية العامة== | ==البنية العامة== | ||
<syntaxhighlight lang="kotlin"> | <syntaxhighlight lang="kotlin"> | ||
− | fun CharSequence. | + | fun CharSequence.toSortedSet(): SortedSet<Char> |
− | </syntaxhighlight> | + | |
+ | </syntaxhighlight>'''منصة التشغيل المطلوبة:''' JVM. | ||
+ | |||
==القيم المعادة== | ==القيم المعادة== | ||
− | [[Kotlin/ | + | تعاد مجموعة جديدة من النوع [[Kotlin/collections/SortedSet|<code>SortedSet</code>]] تحوي جميع محتويات |
==أمثلة== | ==أمثلة== | ||
− | + | مثالٌ على استعمال الدالة <code>toSortedSet()</code>:<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> | ||
==انظر أيضًا== | ==انظر أيضًا== | ||
− | * | + | *الدالة [[Kotlin/kotlin.text/toBigInteger|<code>toBigInteger()</code>]]: تحلّل [[Kotlin/String|السلسلة النصية]] التي استٌدعيت معها وتحوّلها إلى عدد من النوع <code>BigDecimal</code>. |
− | + | *الدالة <nowiki/>[[Kotlin/kotlin.text/toDouble|<code>toDouble()</code>]]: تحلّل السلسلة النصية التي استٌدعيت معها وتحوّلها إلى <nowiki/>[[Kotlin/Double|عدد عشري مضاعف]]. | |
− | * < | ||
− | |||
− | |||
− | *< | + | * الدالة <nowiki/>[[Kotlin/kotlin.text/toFloat|<code>toFloat()</code>]]: تحلّل السلسلة النصية التي استٌدعيت عبرها وتحوّلها إلى <nowiki/>[[Kotlin/Float|عدد عشري]]. |
− | *<code>[[Kotlin/kotlin.text/ | + | * الدالة <nowiki/>[[Kotlin/kotlin.text/toHashSet|<code>toHashSet()</code>]]: تحلّل كائنًا من النوع <code>HashSet</code> يحوي كل محارف <nowiki/>[[Kotlin/CharSequence/index|السلسلة]] التي استٌدعيت معها. |
+ | * الدالة [[Kotlin/kotlin.text/toList|<code>toList()</code>]]: تضيف كل محارف [[Kotlin/CharSequence|سلسلة المحارف]] التي استٌدعيت معها إلى [[Kotlin/collections/List|قائمة]]، إذ يوضع كل محرف في عنصر. | ||
+ | * الدالة [[Kotlin/kotlin.text/toMutableList|<code>toMutableList()</code>]]: تضيف كل محارف [[Kotlin/CharSequence|سلسلة المحارف]] التي استٌدعيت معها إلى [[Kotlin/collections/List|قائمة متغيرة]]، إذ يوضع كل محرف في عنصر. | ||
+ | * الدالة [[Kotlin/kotlin.text/toPattern|<code>toPattern()</code>]]: تحول [[Kotlin/String|السلسلة النصية]] التي استٌدعيت معها إلى نمط. | ||
+ | * الدالة [[Kotlin/kotlin.text/toRegex|<code>toRegex()</code>]]: تحول [[Kotlin/String|السلسلة النصية]] التي استٌدعيت معها إلى [[Kotlin/kotlin.text/Regex/index|تعبير نمطي]] (regular expression). | ||
+ | * الدالة [[Kotlin/kotlin.text/toSet|<code>toSet()</code>]]: تضيف كل محارف [[Kotlin/CharSequence/index|سلسلة الحروف]] التي استٌدعيت معها إلى مجموعة من النوع <code>[[Kotlin/Set|Set]]</code>، إذ يوضع كل محرف في عنصر. | ||
+ | * الدالة [[Kotlin/kotlin.text/toString|<code>toString()</code>]] : تحول العدد الذي استٌدعي معها وفقًا لأساس مُحدّد إلى [[Kotlin/String|سلسلة نصية]]. | ||
+ | * الدالة [[Kotlin/text/toUpperCase|<code>toUpperCase()</code>]]: تحول [[Kotlin/Char|المحرف]] أو جميع محارف [[Kotlin/String|السلسلة النصية]] التي استٌدعيت معها إلى محارف كبيرة (uppercase). | ||
− | |||
==مصادر== | ==مصادر== | ||
− | *[http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-set.html صفحة الدالة | + | *[http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/to-sorted-set.html صفحة الدالة toSortedSet() في التوثيق الرسميّ للمكتبة القياسيّة في لغة Kotlin.] |
[[تصنيف:Kotlin]] | [[تصنيف:Kotlin]] | ||
− | [[تصنيف:Kotlin | + | [[تصنيف:Kotlin Function]] |
+ | [[تصنيف:Kotlin Text]] |
المراجعة الحالية بتاريخ 11:14، 6 سبتمبر 2018
تضيف الدالة toSortedSet()
كل محارف السلسلة التي استٌدعيت معها إلى مجموعة من النوع SortedSet
، إذ يوضع كل محرف في عنصر.
البنية العامة
fun CharSequence.toSortedSet(): SortedSet<Char>
منصة التشغيل المطلوبة: JVM.
القيم المعادة
تعاد مجموعة جديدة من النوع SortedSet
تحوي جميع محتويات
أمثلة
مثالٌ على استعمال الدالة 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]
}
انظر أيضًا
- الدالة
toBigInteger()
: تحلّل السلسلة النصية التي استٌدعيت معها وتحوّلها إلى عدد من النوعBigDecimal
. - الدالة
toDouble()
: تحلّل السلسلة النصية التي استٌدعيت معها وتحوّلها إلى عدد عشري مضاعف.
- الدالة
toFloat()
: تحلّل السلسلة النصية التي استٌدعيت عبرها وتحوّلها إلى عدد عشري. - الدالة
toHashSet()
: تحلّل كائنًا من النوعHashSet
يحوي كل محارف السلسلة التي استٌدعيت معها. - الدالة
toList()
: تضيف كل محارف سلسلة المحارف التي استٌدعيت معها إلى قائمة، إذ يوضع كل محرف في عنصر. - الدالة
toMutableList()
: تضيف كل محارف سلسلة المحارف التي استٌدعيت معها إلى قائمة متغيرة، إذ يوضع كل محرف في عنصر. - الدالة
toPattern()
: تحول السلسلة النصية التي استٌدعيت معها إلى نمط. - الدالة
toRegex()
: تحول السلسلة النصية التي استٌدعيت معها إلى تعبير نمطي (regular expression). - الدالة
toSet()
: تضيف كل محارف سلسلة الحروف التي استٌدعيت معها إلى مجموعة من النوعSet
، إذ يوضع كل محرف في عنصر. - الدالة
toString()
: تحول العدد الذي استٌدعي معها وفقًا لأساس مُحدّد إلى سلسلة نصية. - الدالة
toUpperCase()
: تحول المحرف أو جميع محارف السلسلة النصية التي استٌدعيت معها إلى محارف كبيرة (uppercase).