|
ru.perl- RU.PERL ---------------------------------------------------------------------- From : John Lepikhin 2:5070/156 21 May 2002 04:14:46 To : Vikentiy Trofimov Subject : Re: Задача... даже нет - задачка :) -------------------------------------------------------------------------------- Приветствую, Vikentiy. !> On 20 May 02 20:47:30 +0900, Vikentiy -> All: VT> В переменной нужно символы перевода строки заменить на VT> пробелы. Заранее огромное спасибо! perldoc perlop: =========== tr/SEARCHLIST/REPLACEMENTLIST/cds y/SEARCHLIST/REPLACEMENTLIST/cds Transliterates all occurrences of the characters found in the search list with the corresponding character in the replacement list. [skip] Options: c Complement the SEARCHLIST. d Delete found but unreplaced characters. s Squash duplicate replaced characters. [skip] =========== $string = "it's line one\n\n\n\n\n\nnext line\none more line\nlast line"; $string =~ tr/\n/ /s; print "$string\n"; результат: it's line one next line one more line last line -- ... [лесные компьютерщики] {allnet} {ptoss} --- Gnus/5.0808 (Gnus v5.8.8) XEmacs/21.1 (Cuyahoga Valley) * Origin: A poorly-installed InterNetNews site (2:5070/156.0) Вернуться к списку тем, сортированных по: возрастание даты уменьшение даты тема автор
Архивное /ru.perl/35148f1aac2fe.html, оценка из 5, голосов 10
|