Remove the LaTeX boxed command from a string. Args: s: String with format "\\boxed{content}" Returns: The content inside the boxed command
(s: str)
| 49 | |
| 50 | |
| 51 | def remove_boxed(s: str) -> str: |
| 52 | """Remove the LaTeX boxed command from a string. |
| 53 | |
| 54 | Args: |
| 55 | s: String with format "\\boxed{content}" |
| 56 | |
| 57 | Returns: |
| 58 | The content inside the boxed command |
| 59 | """ |
| 60 | left = "\\boxed{" |
| 61 | assert s[:len(left)] == left, f"box error: {s}" |
| 62 | assert s[-1] == "}", f"box error: {s}" |
| 63 | return s[len(left):-1] |
| 64 | |
| 65 | |
| 66 | class timeout: |
no outgoing calls
no test coverage detected