Your achievements

Level 1

0% to

Level 2

Tip /
Sign in

Sign in to Community

to gain points, level up, and earn exciting badges like the new
BedrockMission!

Learn more

View all

Sign in to view all badges

How i access via script a single element from a textfield defined as Comb Of Characters?

m_tavares
Level 1
Level 1

How i access via script a single element from a textfield defined as Comb Of Characters?

3 Replies
radzmar
Level 10
Level 10

You can use the charAt() method which returns a characters at the defined index position (index is 0-based).

var singleChar = Textfield.rawValue.charAt(2); // returns the 3rd character

m_tavares
Level 1
Level 1

hi, thanks for answer, but didn't work! I got a errorCapturar.PNG

this the code:

var teste = Campotexto3.rawValue.charAt(2)

$host.messageBox(teste)

radzmar
Level 10
Level 10

You have to select JavaScript as language in the script editor!