function [ code ] = decomment( stmt )
% DECOMMENT Remove any comment from a string representing a programming
% language statement

commentPlaces = find( stmt == '#' );

if length( commentPlaces ) > 0
    codeEnd = commentPlaces(1) - 1;
    code = stmt( 1 : codeEnd );
else
    code = stmt;
end

end