[Tutor] perl's chomp equivalent?

Tim Condit timc@ans.net
Mon, 17 Jul 2000 17:17:41 -0400 (EDT)


Hi, 

Is there anything similar to perl's chomp, which removes newline
characters from the end of a line? I'm using this, which works just fine
if not..

--

def main():
    file1 = re_proc(sys.argv[1], p1)
    file2 = re_proc(sys.argv[2], p1)
    merge_file = union(a, b)	

    for i in range(len(merge_file)):
        if merge_file[i][-1] == "\n":
            print merge_file[i][:-1]
        else:
            print merge_file[i]

--

thanks, 
Tim Condit
UUNet Network Quality Services
734-214-7548
tcondit@uu.net