Here's a simple function that takes a string as the name parameter and returns its ASCII value as a number:
main.swift151 chars8 lines
This method works by iterating through each character in the string and adding its ASCII value to a running total. Finally, the total is returned as the result.
Here's an example usage of this function:
main.swift79 chars3 lines
gistlibby LogSnag