Each soldier carried objects that could be useful for personal hygene: the razor was one of the most common objects. It's almost impossible to find a soldier with a long beard, as the majority of armied forbid it.