Jump to content
Macro Express Forums

1st number or letter of a number/word


Recommended Posts

Hello everyone.


I was wondering if anyone had a simple way of being able to detect the 1st number or letter in a string of text or numerals


For example:


Number: 1400356890 I want to be able to parse and detect the number "1"

Letter: incredible. I want to be able to detect and parse the letter "i".


Also, the number has 10 digits. How do you count them?

The word "incredible" has 10 letters. How do you count them?


Simple enough right?


I hope.



Link to comment
Share on other sites

Once you have your word in a text variable, get the first character into another text variable by using Variable Modify String [Copy Part of Text].


Counting characters in word: Variable Set Integer[Get Length of a Text Variable].


For the number, first convert it to a text string using either Variable Modify Decimal or Variable Modify Integer. Then proceed as with the text variable above, to find the first character (digit) or count the digits. Note that when you convert to a string there will be no leading zeros in the string.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...