Announcement

Collapse
No announcement yet.

Strings rausfiltern und ersetzen

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #31
    Hallo,
    Originally posted by reneeb View Post
    Nur mal als Hinweise, was man hier besser machen kann:...
    Code:
    sub CleanCFG {
        my @CFG_PLT;
    
        if( open my $CFG_PLT, '<', $CFG_PLT) ) {
            @CFG_PLT=<$CFG_PLT>;
            close ($CFG_PLT);
        }
    
        foreach(@CFG_PLT) {
            $pos_ = rindex($_,"_");
            if ($pos_ != -1) {
                push @CFG_PLT_CLEAN, substr($_,0,$pos_+1);
            }
        }
    }
    Z.B. noch die Formatierung im Forum mit BB-Code für Perl:
    [highlight=perl]
    Perl-Code
    [/highlight]

    [highlight=perl]
    sub CleanCFG {
    my @CFG_PLT;

    if( open my $CFG_PLT, '<', $CFG_PLT) ) {
    @CFG_PLT=<$CFG_PLT>;
    close ($CFG_PLT);
    }

    foreach(@CFG_PLT) {
    $pos_ = rindex($_,"_");
    if ($pos_ != -1) {
    push @CFG_PLT_CLEAN, substr($_,0,$pos_+1);
    }
    }
    }
    [/highlight]

    Gruß Falk
    Wenn du denkst du hast alle Bugs gefunden, dann ist das ein Bug in deiner Denksoftware.

    Quellcode ohne ein Mindestmaß an Formatierung sehe ich mir nicht an! Ich leiste keinen Privatsupport per Mail oder PN!

    Comment

    Working...
    X