Quantcast
Channel: Active questions tagged string-manipulation - Mathematica Stack Exchange
Viewing all articles
Browse latest Browse all 189

Convert String to List of Numbers

$
0
0

I want to create a function that when a string is entered it will turn it into a list of numbers, these numbers are the numerical form of the characters in the string.

e.g. a=1, b=2, c=3, d=4 and space = 27 (other punctuation may be needed).

So if I had the string "hello", my result would be: {8, 5, 12, 12, 15}

I had a look at StringReplace, StringSplit and Characters, but not sure what is optimal.

How would I go about doing this?


Viewing all articles
Browse latest Browse all 189

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>