Kristofer Wolff wrote:
>
> -----Ursprüngliche Nachricht-----
> Von: Kristofer Wolff [mailto:[EMAIL PROTECTED]]
> Gesendet: Donnerstag, 18. Januar 2001 13:46
> An: perllist
> Betreff: RegExp thing
>
> hi all,
>
> i am making a simple spell check and want to chk if one letter is worg, so i
> neet to modify the words from my wordlist like:
>
> Word = example
> mod1 = .xample
> mod2 = e.ample
> mod3 = ex.mple
> mod4 = exa.ple
> mod5 = exam.le
> mod6 = examp.e
> mod7 = exampl.
>
> if done this way:
>
> $wortlange = length($chkwith);
> for($i=0;$i<=$wortlange;$++)
> {
> # ...
> push(@adv1chk, $try);
> }
>
> so far i need a code that change the "n" letter into a dot.
>
> any idea ?
One way:
use strict;
my @adv1chk = ();
my $chkwith = 'example';
my $wortlange = length $chkwith;
for (my $ii = 0; $ii < $wortlange; $ii++) {
my $try = $chkwith;
substr ($try, $ii, 1) = '.';
push @adv1chk, $try;
}
--
,-/- __ _ _ $Bill Luebkert ICQ=14439852
(_/ / ) // // DBE Collectibles http://www.todbe.com/
/ ) /--< o // // Mailto:[EMAIL PROTECTED] http://dbecoll.webjump.com/
-/-' /___/_<_</_</_ http://www.freeyellow.com/members/dbecoll/
_______________________________________________
Perl-Win32-Web mailing list
[EMAIL PROTECTED]
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web