Forum » Programiranje » [c#] Filename difference
[c#] Filename difference
![](https://static.slo-tech.com/stili/avatar_gray.gif)
purki ::
Rabil bi metodo, ki pove (true, false) če sta datoteki po imenu "enaki": in sicer bi rad primerjal datoteko s polnim imenom s poljubno masko.
Primer:
jan2007.txt && ???2007.txt -> true
jan2008.txt && ???2007.txt -> false
hvala
Primer:
jan2007.txt && ???2007.txt -> true
jan2008.txt && ???2007.txt -> false
hvala
- spremenilo: purki ()
![](https://static.slo-tech.com/stili/avatar_gray.gif)
darkolord ::
(new System.Text.RegularExpressions.Regex(@"^.*?2007.txt$")).IsMatch("jan2007.txt") (new System.Text.RegularExpressions.Regex(@"^.*?2007.txt$")).IsMatch("jan2008.txt")
^ začetek stringa
$ konec string
.*? poljubno število katerihkoli znakov (kot *)
Zgodovina sprememb…
- spremenilo: darkolord ()
Vredno ogleda ...
Tema | Ogledi | Zadnje sporočilo | |
---|---|---|---|
Tema | Ogledi | Zadnje sporočilo | |
» | Pomoč pri kontakt formiOddelek: Izdelava spletišč | 18518 (18416) | Vzdevek |
» | branje iz datoteke c#Oddelek: Programiranje | 1660 (1389) | darkolord |
» | c# regularni izrazOddelek: Programiranje | 2045 (1743) | darkolord |
» | [PHP] Rezanje stringov ter nekaj malenkostiOddelek: Programiranje | 1846 (1600) | roli |
» | [c#] string.TrimOddelek: Programiranje | 1330 (1276) | darkolord |