'Google Spreadsheet) How to leave unique row values by left n characters?

Using google spreadsheet, is there any way to leave unique values by left n characters?

For example, assume that I have a data set as below :

[AAA/123 AAA/345 BBB/123 CCC/123]

I want to just leave below 3 values filtered by first 3 characters (AAA/345 should be deleted)

[AAA/123 BBB/123 CCC/123]



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source