# string.Explode

- **Ortam:** İstemci, Sunucu, Menü
- **İngilizce aslı:** https://wiki.facepunch.com/gmod/string.Explode
- **Çeviri tarihi:** 2026-05-03

```lua
table string.Explode( string separator, string str, boolean withpattern = false )
```

## Açıklama

Verilen ayırıcıyı bulduğu her yerde bir iplik bölüyor.

Fonksiyonu [string. Split](https://gmod.tr/wiki/string.Split) Bu fonksiyonun bir takma adıdır, ancak function doesn desen kullanmayı desteklemez.

Görelim. [string. Implode](https://gmod.tr/wiki/string.Implode) Bu fonksiyonun ters çalışması için.

## Argümanlar

1.. [dizgin](https://gmod.tr/wiki/string) **Ayırıcı**: Dizgi bu dizinin bulunduğu her yerde ayrılır.
2.. [dizgin](https://gmod.tr/wiki/string) **str**: Bölmek için iplik.
3.. [Boolean](https://gmod.tr/wiki/boolean) **Şablonla.** = yanlış: Eğer ayırıcınız bir ise bunu doğru olarak ayarlayın. [Şablon](https://gmod.tr/wiki/Patterns).

## Geri dönüşler

1.. sıralı [Tablo](https://gmod.tr/wiki/table)[dizgin](https://gmod.tr/wiki/string)>: Bir sayısal sıralama tablosu olarak patlamış bir dize.

### Örnek

Bir cümleyi içindeki kelimelerin tablosuna ayırır.

```lua
local sentence = "hello there my name is Player1"
local words = string.Explode( " ", sentence )
PrintTable( words )
```

**Çıkış:**

```lua
1 = hello
2 = there
3 = my
4 = name
5 = is
6 = Player1
```

### Örnek

Bir oyuncunun söylediği kelimeleri sıralamak için Explode kullanır.

```lua
hook.Add( "PlayerSay", "GiveHealth", function( ply, text )
	local playerInput = string.Explode( " ", text )

	if ( playerInput[1] == "!givehealth" ) then

		if ( tonumber( playerInput[2] ) ) then

			ply:SetHealth( tonumber( playerInput[2] ) )

			print( ply:Nick() .. " set their health to " .. playerInput[2] )

		end

	end

end)
```

**Çıkış:**

```lua
Player1 set their health to 100.
```

### Örnek

Bir cümleyi her basamakta bir tabloya ayırır.

```lua
local sentence = "Separated 4 every digit like 1 and 2"
local words = string.Explode("%d", sentence, true)
PrintTable( words )
```

**Çıkış:**

```lua
1 =	Separated
2 =	 every digit like
3 = and
4 =
```

- [GMod Wiki ana sayfası](https://gmod.tr/wiki)

---

[Tüm sunucular](https://gmod.tr/) · [GmodTR Launcher](https://gmod.tr/launcher) · [Rehber](https://gmod.tr/rehber) · [GMod Wiki](https://gmod.tr/wiki) · [GmodTR nedir?](https://gmod.tr/hakkinda) · [Sunucu ekle](https://gmod.tr/sunucu-ekle) · [Discord](https://discord.gg/gmodtr)

Kaynak: https://gmod.tr/wiki/string.Explode
