|
|
|
(Perl) как убрать все пробелы из строки
|
|||
|---|---|---|---|
|
#18+
Скажем есть: my $str = ' аа ммed df 34 '; Можно регулярным выражением убрать все пробелы из строки? ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.11.2005, 09:36 |
|
||
|
(Perl) как убрать все пробелы из строки
|
|||
|---|---|---|---|
|
#18+
Код: plaintext ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.11.2005, 09:40 |
|
||
|
(Perl) как убрать все пробелы из строки
|
|||
|---|---|---|---|
|
#18+
Спасибо! ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.11.2005, 09:48 |
|
||
|
(Perl) как убрать все пробелы из строки
|
|||
|---|---|---|---|
|
#18+
Вынимаю из базы значение в массив и делаю: $kod[$iCount]=~s/\s//g; Результат - все элименты массива становятся одинаковыми. Попробовал через переменную (принимаю значение вначале в переменную, обрабатываю и только потом присваиваю значение элементу массива). Без разницы... ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.11.2005, 10:51 |
|
||
|
(Perl) как убрать все пробелы из строки
|
|||
|---|---|---|---|
|
#18+
map map map {block} list map expr, list Evaluates the block or expr for each element of list (locally setting $_ to each element) and returns the list value composed of the results of each such evaluation. It evaluates block or expr in a list context, so each element of list may produce zero, one, or more elements in the returned value. These are all flattened into one list. For instance: @words = map { split ' ' } @lines; splits a list of lines into a list of words. Often, though, there is a one-to-one mapping between input values and output values: @chars = map chr, @nums; This statement translates a list of numbers to the corresponding characters. @words = map {s/\s//g} @lines; ... |
|||
|
:
Нравится:
Не нравится:
|
|||
| 10.11.2005, 11:33 |
|
||
|
|

start [/forum/topic.php?fid=23&msg=33370279&tid=1477291]: |
0ms |
get settings: |
8ms |
get forum list: |
13ms |
check forum access: |
3ms |
check topic access: |
3ms |
track hit: |
174ms |
get topic data: |
9ms |
get forum data: |
2ms |
get page messages: |
40ms |
get tp. blocked users: |
1ms |
| others: | 204ms |
| total: | 457ms |

| 0 / 0 |
