def TruncateString(raw_string, max_length):
  """Returns truncated raw_string based on max length.

  Args:
    raw_string: String to be truncated.
    max_length: max length of string.

  Returns:
    string: The truncated string.
  """
  if len(raw_string) > max_length:
    return raw_string[:max_length]
  return raw_string