Handling substring error

Handling substring error

Hi,
I use substring(0, 4) to extract the first 4 charaters in the Last_NAME field
But when the person enters a name like John Doe,

I get an error telling ( it is supposed to extract 4, but only 3 is available)
-- fair enough.

Anyway i can bypass this error.

Thank you,
Regards
Deepa