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

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

انظر أيضًا

مصادر