```ts
export function clipText(text: string, from: number, to: number): string {
  if (from > to) {
    throw new Error("First place must be less than or equal to second place.");
  }

  return text.slice(from, to + 1);
}
```