Detect typed character in dynamic text filed

Hi does any one know how to detect the number of character typed in a dynamic text field.

like
if (Text_field.CharacterSet = 12)
button._Enabled = true;
}else{
button._Enabled = true;
}
}

or something like that??