(1) Whenever any person is arrested by a police officer, or any other person, under any of the provisions of this Code, the officer or person making the arrest may search the person and place in safe custody all articles other than necessary wearing apparel found on him or her.
(2) Whenever it is necessary to cause a female to be searched, the search shall be made by another female with strict regard to decency.