Source language: Translate to:

Extract only numbers from string

Questions about using NeoBook's scripting language

Moderator: Neosoft Support

Extract only numbers from string

Postby chromebandit » Sat Apr 06, 2013 10:12 pm

Extract only the numeric characters from a string..... Vbscript

You can download if you like:
http://neoplugs.promosoft.biz/wp-content/uploads/2013/04/Extract-Numbers.zip

Regards
User avatar
chromebandit
 
Posts: 283
Joined: Wed Nov 24, 2010 5:00 pm

I use this

Postby virger » Sun Apr 07, 2013 8:28 pm

I use this, I can take one or more numbers than once

{NeoBook Function}
Version=5.70
Language=JScript
Param=[%str]|Variable|String
Param=[%ret]|Variable|Return Number(s)
{End}
nbSetVar( "[%ret]", nbGetVar("[%str]").match(/\d+/g))



=========
setvar "[Str]" "Hi 123 Friend 456 Pura 678 Vida"
Call "Str2Num" "[Str] "[Ret]"

...ret === 123,456,678
----------------------------
From Costa Rica
PURA VIDA
COSTA RICA
PURA VIDA
User avatar
virger
 
Posts: 518
Joined: Mon Sep 18, 2006 12:21 pm
Location: Costa Rica, America Central


Return to NeoBook Action Commands

Who is online

Users browsing this forum: No registered users and 1 guest

cron