def _StripTrailingWhitespaceFromLines(string):
  """Strips trailing whitespace from each line of the provided string.

  Args:
    string: (str) string to remove trailing whitespace from

  Returns:
    (str) input string, with trailing whitespace stripped from each line
  """
  return '\n'.join(line.rstrip() for line in string.split('\n'))