Quantcast
Channel: Boşluk kontrol methodu
Viewing all articles
Browse latest Browse all 6

Boşluk kontrol methodu

0
0

Merhaba arkadaşlar

Textboxtan aldığım veride boşluk kontrolü yapan bir methodum var birinci yöntemde string olarak genel değer olarak alıyorum çalışmıyor ikinci yöntemde ise textbox olarak nesne tanımlıyorum sonuc döndürüyor anlayamadım 

public static void boslukkontrol(string txt) { string sonuc=""; for (int i = 0; i < txt.Length; i++) { if (txt.Substring(i, 1) != " ") { sonuc = sonuc + txt.Substring(i, 1); } } txt = sonuc;

  private void button3_Click_1(object sender, EventArgs e)
        {  ortakmethod.boslukkontrol(textBox1.Text);  }

2. ikinci yöntem ile yapınca oluyor o da şöyle 

public static void boslukkontrol(TextBox txt) { string sonuc=""; for (int i = 0; i < txt.TextLength; i++) { if (txt.Text.Substring(i, 1) != " ") { sonuc = sonuc + txt.Text.Substring(i, 1); } } txt.Text = sonuc; }

   private void button3_Click_1(object sender, EventArgs e)
        {  ortakmethod.boslukkontrol(textBox1);  }





 


Viewing all articles
Browse latest Browse all 6

Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.2 by Vimeo.com, Inc.

Vimeo 10.6.2 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Re:

Re:





Latest Images

Vimeo 10.7.0 by Vimeo.com, Inc.

Vimeo 10.7.0 by Vimeo.com, Inc.

HANGAD

HANGAD

MAKAKAALAM

MAKAKAALAM

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Doodle Jump 3.11.30 by Lima Sky LLC

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.1 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Vimeo 10.6.0 by Vimeo.com, Inc.

Re:

Re:

Re:

Re: