🔧 10. String operations
Nachrichtenbereich: 🔧 Programmierung
🔗 Quelle: dev.to
10. String operations
a)Quyidagi kod nima qiladi?
string name = "John" ;
string upperName = name. ToUpper ();
Console. WriteLine (upperName);
b)Stringlarni birlashtirishning bir usulini keltiring.
c)Stringlarni solishtirish uchun qaysi metod ishlatiladi?
Javoblari:
a) Tekstdagi hamma harflarni kottadan yozib beradi;
b) Replace() metodi orqali ma'lum bir qatorni boshqa qiymatga almashtirish mumkin.
using System;
using System.Text;
c)
class Program
{
static void Main()
{
StringBuilder sb = new StringBuilder("Hello Beautiful World!");
sb.Remove(6, 10);
Console.WriteLine(sb.ToString());
}
}
c) Agar siz stringlarning ma'lum bir tartibda
(masalan, katta-kichik harflarga qarab)
solishtirishni xohlasangiz, compareTo() metodidan
foydalanishingiz mumkin.
🔧 C Print String – How to Print a String in C
📈 18.66 Punkte
🔧 Programmierung
🐧 SVGZ / XML replacing string with string
📈 18.66 Punkte
🐧 Linux Tipps
🔧 string vs String
📈 18.66 Punkte
🔧 Programmierung
🔧 String Operations
📈 17.77 Punkte
🔧 Programmierung
🔧 10. String Operations
📈 17.77 Punkte
🔧 Programmierung
🔧 String Operations
📈 17.77 Punkte
🔧 Programmierung