Customize paste operation with character limitation

I’d like to custom paste operation with clipboard content. Its like cut partial documentation in editor schema and similar like cut operation. Because i setup the character limit in edit operation. case: This characters limit is 3. There is 2 characters in my editor content and 2 characters in clipboard, then do paste operation. It will be cut 1 characters from clipboard. E.g.: before paste: [AB], after paste: [ABC].