TABLE OF CONTENTS
::pwtk::trim_prefix
SYNOPSIS
proc ::pwtk::trim_prefix {prefixes filename} {
ARGUMENTS
- prefixes -- list of prefixes to trim
- filename -- name of file
PURPOSE
Return the filename left-trimmed for the prefix. For example:
::pwtk::trim_prefix {relax scf} relax.file.in ::pwtk::trim_prefix {relax scf} scf.file.in
returns:
file.in file.in
SOURCE
foreach prefix $prefixes { set prefix [string trimright $prefix .] lappend rexp "^$prefix\." } return [regsub [join $rexp |] $filename {}] }