import re


def Strip(string, remove_blanks=True):
  """Remove AIS string padding @ characters and spaces on the right.

  Args:
    string: A string to cleanup.
    remove_blanks: Set to true to strip spaces on the right.

  Returns:
    A cleaned up string.
  """
  string = re.sub('@.*', '', string)
  if remove_blanks:
    return string.rstrip()
  return string