toGematria

fun String.toGematria(): Int

Converts a Hebrew string to its corresponding numerical value (Gematria).

This function processes each character of the given string, converts valid Hebrew letters to their associated numerical value, and sums them to return the total Gematria value. Non-Hebrew characters (such as spaces, punctuation, or any other symbols) are ignored.

Receiver

String The Hebrew string to convert. The string may contain non-Hebrew characters, which will be ignored.

Return

The numerical value (Gematria) of the string, as an integer.

Samples