I have
def testStr = 'a:*b*c*d'
I want to get
tokens[0]=='a'
tokens[1]=='b*c*d'
I try
def tokens = testStr.tokenize(':*')
but get
tokens[0]=='a'
tokens[1]=='b'
tokens[2]=='c'
tokens[3]=='d'
How can I do this thing
Disadvantages of Tokenization Implementing tokenization does certainly add a layer of complexity to your IT structure, with processing transactions becoming more complicated and comprehensive. It also doesn't eliminate all security risks.
The challenge is to find a framework where the key value proposition of tokenized assets is not significantly diminished or lost in the process. The current proposals for security token standards are still at an early stage and are expected to evolve considerably over time.
Challenges in Tokenization One of the biggest challenges in the tokenization is the getting the boundary of the words. In English the boundary of the word is usually defined by a space and punctuation marks define the boundary of the sentences, but it is not same in all the languages.
Tokenization replaces the Primary Account Number (PAN) with randomly generated tokens. If intercepted, the data contains no cardholder information, rendering it useless to hackers.
tokenize
takes a list of possible tokens, so it's splitting on both :
and *
You probably want split
which takes a regular expression to split on (and returns a String[]
):
def testStr = 'a:*b*c*d'
def tokens = testStr.split( /:\*/ )
assert tokens[ 0 ] == 'a'
assert tokens[ 1 ] == 'b*c*d'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With