I have to do a check. I have to search for an email through a nif/dni. The thing is that I need to remove the letter from the ID to search for an email associated with said ID.
I have been reviewing the StringUtils class, I have already used it before. The thing is that with split you need a separator character to tell it where to cut the string. Could someone tell me how I could do it, so that I can remove the last character of the ID and verify that it is a letter that it removes?
Thank you very much in advance
You search :
charAt()
The method returns the character at the specified index in a string.
char letraDNI = dni.charAt(dni.length() - 1);
I think you can play with it now.
that happens with some special characters for example . or , or \ are several
You should use a Patern like this: