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