string contains only numbers kotlin code example Example: kotlin string contains integer str.matches(".*\\d.*");