Ignore:
Timestamp:
Feb 18, 2009, 2:44:41 PM (14 years ago)
Author:
rwilson
Message:

Ongoing conversion changes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/numpy/anuga/utilities/system_tools.py

    r5921 r6360  
    246246    #    p1 = read_polygon(path)
    247247       
    248            
    249 
    250 
     248       
     249##
     250# @brief Split a string into 'clean' fields.
     251# @param str The string to process.
     252# @param delimiter The delimiter string to split 'line' with.
     253# @return A list of 'cleaned' field strings.
     254# @note Any fields that were initially zero length will be removed.
     255# @note If a field contains '\n' it isn't zero length.
     256def clean_line(str, delimiter):
     257    """Split string on given delimiter, remove whitespace from each field."""
     258
     259    return [x.strip() for x in str.split(delimiter) if x != '']
     260
     261
Note: See TracChangeset for help on using the changeset viewer.