Jump to content

Help: How to work extract some characters from word.


Go to solution Solved by Malkey,

Recommended Posts

Hey guys,

Can somebody help me with this?

Used word: AA:BB:CC

Constant word: 12345_5678

I need a script to take the last 3 character from AA:BB:CC, EXCEPT for the ":" symbol so that the result will be:

12345BCC_5678

 

TIA

 

 

 

Link to comment
Share on other sites

How I would do it, most likely not the easiest way as I'm Sure it could be done with StringRegExpReplace

$vWord = "AA:BB:CC"
$vConstantWord = "12345_5678"

$vString = StringRight(StringReplace($vWord,":", ""), 3) ;~ AABBCC
$vString2 = StringSplit($vConstantWord, "_", 2) ;~ Split Constant Word Into Array

$vOutput = ($vString2[0] & $vString & "_" & $vString2[1]) ;~ 12345, BCC, _, 5678

ConsoleWrite($vOutput)
Edited by mrflibblehat

[font="'courier new', courier, monospace;"]Pastebin UDF | Prowl UDF[/font]

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...