Notes![what is notes.io? What is notes.io?](/theme/images/whatisnotesio.png)
![]() ![]() Notes - notes.io |
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication28
{
class Program
{
static void Main(string[] args)
{
#region Concat
string a = "Ertan";
string b = "Er";
string a2 = "301";
string c = string.Concat(a, b, a2);// stringleri toplar
Console.WriteLine(c);//ErtanER301 yazdı
#endregion
#region Compare
string d = "Ertan";
string e = "Er";
int f = string.Compare(d,e);
/*1 ve -1 değerleri değerlerin farklı olduğunu,
* 0 ise aynı olduklarını belirtir.
* 1 değeri birinci parametrenin büyük,
* 0 değeri eşit ve -1 değeri ise ikinci
* parametrenin büyük olduğunu gösterir. */
Console.WriteLine(f);
#endregion
#region StartsWhit
/*Bir String ifadenin belirtilen değer ile başlayıp
* başlamadığını
* bulmamıza yarayan metoddur. Başlıyor ise TRUE,
* başlamıyor ise FALSE değerini döndürür.*/
string g = "Ertan Er";
bool h = g.StartsWith("Er");
Console.WriteLine(h);
#endregion
#region EndsWitch
/*StartsWhit’in tersi olarak bir string ifade belirtilen
* değer ile
* bitip bitmediğini kontrol eder.*/
h = g.EndsWith("Er");
Console.WriteLine(h);
#endregion
#region Trim
/*Bu metod üzerinde işlem yaptığı ifadenin başındaki ve
* sonundaki boşlukları siler.
*Aynı zamanda başında veya sonundaki belirtiğimiz bir
* ifadeyi de arayıp silebilir.*/
string i = "Ertan Er";
string j = i.Trim();
Console.WriteLine(j);
Console.WriteLine();
string x = i.Trim('E');
Console.WriteLine("x :"+x);
Console.WriteLine();
char[] dizi = { 'E', 'r' };
string k = i.Trim(dizi);
Console.WriteLine("k: "+k);
#endregion
#region PadLeft / PadRight
/*String bir ifadeye soldan / sağdan dolgu yapar.
*Boşluk veya belirttiğimiz bir karakterle de dolguyu yapabiliriz.*/
int l = 300;
string sayı1 = l.ToString();
string m = sayı1.PadLeft(10);/*300 Sayısına Soldan 10 Tane Karakter Olana
Kadar boşluk ile dolgu yaptık */
Console.WriteLine("m :"+m);
Console.WriteLine();
int n = 1461;
string sayı2 = n.ToString();
Console.WriteLine(sayı2.PadRight(10,'+'));/*1461 sayısına Sağdan 10 Tane
Karakter Olana Kadar Nokta ile Dolgu yaptık*/
#endregion
#region Remove
/*Belirtilen sıradaki karakterden sonraki ifadeleri siler*/
string o = g.Remove(3);
Console.WriteLine("o :"+o);
#endregion
#region Insert
/*Ekleme Metodudur. Belirtiğimiz sıraya yine belirtilen ifadeyi ekler*/
/*"Ertan Er" değerinin sıfırıncı sırasından itibaren "Er " ifadesini ekledik*/
b = g.Insert(0, "Er ");
Console.WriteLine("b :"+b);
#endregion
#region Replace
/*String bir ifadenin içindeki bir ifadeyi bulup istediğimiz
* bir ifade ile değiştirir.*/
b = g.Replace('t', 'c');
Console.WriteLine("b : "+b);
#endregion
#region Split
/*Bu metod string bir ifadeyi belirli bir ayraca göre parçalara ayırır.
* Kendisini, parametre olarak gelen bir stringin içindeki değeri
* belirli bir ayraca göre parçalayarak bir diziye aktarır*/
Console.WriteLine();
Console.WriteLine();
Console.WriteLine();
string z = "Smartpro Bilgisayar Akademisi";
string[] dizi2 = z.Split(' ');
foreach (var item in dizi2)
{
Console.WriteLine(item);
}
#endregion
#region Join
/*Birkaç string ifadeyi birleştirir ve birleştirirken kullanıcının belirlediği
* karakteri kullanarak birleştirme işlemi yapar. Bir sınıfa aittir.*/
Console.WriteLine("-------------------");
/* Önce split ile ifadeyi parçalayalım*/
string deg = "SmartPro Bilgisayar Akademisi 301 Sınıfı";
string[] y = deg.Split(' ');
foreach (var item in y)
{
Console.WriteLine(item);
}
/*Şimdi de Join ile birleştirelim. */
Console.WriteLine("------------------------");
String yeni = String.Join("_", y);
Console.WriteLine(yeni);
#endregion
Console.ReadLine();
}
}
}
![]() |
Notes is a web-based application for online taking notes. You can take your notes and share with others people. If you like taking long notes, notes.io is designed for you. To date, over 8,000,000,000+ notes created and continuing...
With notes.io;
- * You can take a note from anywhere and any device with internet connection.
- * You can share the notes in social platforms (YouTube, Facebook, Twitter, instagram etc.).
- * You can quickly share your contents without website, blog and e-mail.
- * You don't need to create any Account to share a note. As you wish you can use quick, easy and best shortened notes with sms, websites, e-mail, or messaging services (WhatsApp, iMessage, Telegram, Signal).
- * Notes.io has fabulous infrastructure design for a short link and allows you to share the note as an easy and understandable link.
Fast: Notes.io is built for speed and performance. You can take a notes quickly and browse your archive.
Easy: Notes.io doesn’t require installation. Just write and share note!
Short: Notes.io’s url just 8 character. You’ll get shorten link of your note when you want to share. (Ex: notes.io/q )
Free: Notes.io works for 14 years and has been free since the day it was started.
You immediately create your first note and start sharing with the ones you wish. If you want to contact us, you can use the following communication channels;
Email: [email protected]
Twitter: http://twitter.com/notesio
Instagram: http://instagram.com/notes.io
Facebook: http://facebook.com/notesio
Regards;
Notes.io Team