Skip to content
Sign upLog in
← Back to Community

Character Limit?

Profile icon
UrM0MLol

So uh, I want to limit the amount of characters for the player's name but I'm not sure how to do I if I could get the program to like, read the number of characters and store that value in a variable and then I could do the rest from there with an if statement or two

Voters
Profile icon
UrM0MLol
Comments
hotnewtop
Profile icon
Zavexeon

You can get the length of a string like string.Length;

So like:

string myString = "Hello!"; if (myString.Length < char_limit_num_here) { // string meets the character limit }
Profile icon
SebastianLope48

i know im 3 years late, but i use len(string)