الفرق بين المراجعتين ل"Kotlin/kotlin.text/Appendable/Appendable/append"
< Kotlin | kotlin.text | Appendable
اذهب إلى التنقل
اذهب إلى البحث
(أنشأ الصفحة ب'<noinclude>{{DISPLAYTITLE: التابع Appendable.append() في لغة Kotlin}}</noinclude> تعيد الدالة <code>append()</code> القيمة <code>true</c...') |
|||
سطر 1: | سطر 1: | ||
<noinclude>{{DISPLAYTITLE: التابع Appendable.append() في لغة Kotlin}}</noinclude> | <noinclude>{{DISPLAYTITLE: التابع Appendable.append() في لغة Kotlin}}</noinclude> | ||
− | + | تضم الدالة <code>append()</code> كائنا من النوع <code>[[Kotlin/kotlin.text/Appendable/index|Appendable]]</code> إلى الكائن المُمرّر. | |
== البنية العامة == | == البنية العامة == | ||
<syntaxhighlight lang="kotlin"> | <syntaxhighlight lang="kotlin"> | ||
− | + | abstract actual fun append(csq: CharSequence?): Appendable | |
− | </syntaxhighlight> | + | abstract actual fun append( |
+ | csq: CharSequence?, | ||
+ | start: Int, | ||
+ | end: Int | ||
+ | ): Appendable | ||
+ | |||
+ | abstract actual fun append(c: Char): Appendable | ||
+ | |||
+ | |||
+ | </syntaxhighlight>'''بيئة التشغيل المطلوبة: JS''' | ||
== القيم المعادة == | == القيم المعادة == | ||
− | + | كائن من النوع <code>[[Kotlin/kotlin.text/Appendable/index|Appendable]].</code> | |
== أمثلة == | == أمثلة == | ||
− | === استخدام الدالة <code>append()</code> | + | === استخدام الدالة <code>append()</code> === |
− | تُعرّف الشيفرة الآتية [[Kotlin/Char/index| | + | تُعرّف الشيفرة الآتية [[Kotlin/Char/index|سلسلتين نصيتين]] باسم <code>str1</code> و <code>str2،</code> ثم تنشئ كائنا من النوع <code>[[Kotlin/kotlin.text/Appendable/index|Appendable]]</code> باستخدام الدالة <code>StringBuilder()</code>باسم <code>str</code>، ثم تستدعي الدالة <code>append()</code> عبرها، ثم تطبع الناتج:<syntaxhighlight lang="kotlin"> |
− | fun main(args: Array<String>) { | + | fun main(args: Array<String>) { |
− | val | + | val str1 = "hsoub" |
− | val | + | val str2 = "academy" |
+ | val str = StringBuilder() | ||
+ | |||
+ | str.append(str1).append(str2) | ||
− | + | print(str) // hsoubacademy | |
− | print( | ||
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
== انظر أيضًا == | == انظر أيضًا == | ||
− | * <code>[[Kotlin/text/ | + | * صفحة النوع<code>[[Kotlin/kotlin.text/Appendable/index|Appendable]]</code> <code></code>. |
− | |||
− | |||
== مصادر == | == مصادر == | ||
− | * [ | + | * [http://kotlinlang.org/api/latest/jvm/stdlib/kotlin.text/-appendable/-appendable/append.html صفحة الدالة Appendable.append() في التوثيق الرسميّ للمكتبة القياسيّة في لغة Kotlin.] |
[[تصنيف:Kotlin]] | [[تصنيف:Kotlin]] | ||
[[تصنيف:Kotlin Method]] | [[تصنيف:Kotlin Method]] |
مراجعة 13:29، 4 يوليو 2018
تضم الدالة append()
كائنا من النوع Appendable
إلى الكائن المُمرّر.
البنية العامة
abstract actual fun append(csq: CharSequence?): Appendable
abstract actual fun append(
csq: CharSequence?,
start: Int,
end: Int
): Appendable
abstract actual fun append(c: Char): Appendable
بيئة التشغيل المطلوبة: JS
القيم المعادة
كائن من النوع Appendable.
أمثلة
استخدام الدالة append()
تُعرّف الشيفرة الآتية سلسلتين نصيتين باسم str1
و str2،
ثم تنشئ كائنا من النوع Appendable
باستخدام الدالة StringBuilder()
باسم str
، ثم تستدعي الدالة append()
عبرها، ثم تطبع الناتج:
fun main(args: Array<String>) {
val str1 = "hsoub"
val str2 = "academy"
val str = StringBuilder()
str.append(str1).append(str2)
print(str) // hsoubacademy
}
انظر أيضًا
- صفحة النوع
Appendable
.