Satr berilgan bo`lib uning birinchi ikkita simvolidan hosil bo`lgan yangi satr qaytaring. Agar satr uzunligi 2 dan kam bo`lsa, yetmagan simvollar o`rniga ‘@’ belgisini qo`ying.
atFirst("hello") → "he"
atFirst("hi") → "hi"
atFirst("h") → "h@"
String-1 > lastChars
prev | next | chance
Given 2 strings, a and b, return a new string made of the first char of a and the last char of b, so "yo" and "java" yields "ya". If either string is length 0, use '@' for its missing char.
oxirgiBelgilar.
Ikkita a va b satr berilgan, a satrning birinchi va b satrning oxirgi belgisidan hosil bo`lgan yangi satr qaytaring. Agar ikkala satrdan birortasining uzunligi 0 ga teng bo`lsa olinadigan belgi o`rniga ‘@’ belgisini qo`yilgan holda qaytaring.
|
String-1 > conCat
prev | next | chance
Given two strings, append them together (known as "concatenation") and return the result. However, if the concatenation creates a double-char, then omit one of the chars, so "abc" and "cat" yields "abcat".
Ikkita satr berilgan, ularni birin-ketin joylashtish natijasida yangi yaxlit bir satr qaytiring. Agar, satrlar qo`shilishi natijasida bir xil belgilar ketma-ket kelsa bittasi o`chirilsin. Masalan: “abc” va “cat”ni qo`shilishi natijasida “abcat” hosil bo`ladi.
|
String-1 > lastTwo
prev | next | chance
Do'stlaringiz bilan baham: |