Thread Zeichenkette normieren (4 answers)
Opened by jan99 at 2012-12-03 08:38

FIFO
 2012-12-03 08:59
#163855 #163855
User since
2005-06-01
469 Artikel
BenutzerIn

user image
Hi,

Alle Leerzeichen entfernen: $string =~ s/\s//g; (edit: drittes / nachgeholt)
Kleinbuchstaben: $string = lc($string);
Umlaute musst Du ggf. gesondert berücksichtigen, je nach locale.

edit: Kleinbuchstaben mittels RegEx: $string =~ s/(.*)/\L$1/;
Last edited: 2012-12-03 11:17:36 +0100 (CET)
Everyone knows that debugging is twice as hard as writing a program in the first place. So if you're as clever as you can be when you write it, how will you ever debug it? -- Brian Kernighan: "The Elements of Programming Style"

View full thread Zeichenkette normieren