adamgren
|
  |
| Joined: 11 Nov 2008 |
| Total Posts: 614 |
|
|
| 15 Dec 2012 06:28 AM |
| Sorry, I'm working on a script, and I can't remember, or find, the function for counting the number of characters in a string. Can someone post it? |
|
|
| Report Abuse |
|
|
Monkey727
|
  |
| Joined: 12 Jan 2009 |
| Total Posts: 969 |
|
|
| 15 Dec 2012 07:31 AM |
Use "#" infront of the variable holding the string, It returns the length of it. ( I believe )
String = "Hello" print(#String) --> 5 |
|
|
| Report Abuse |
|
|
cygorx
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 668 |
|
|
| 15 Dec 2012 07:36 AM |
Or, alternatively, if you wish to be less efficient, use string.len(). In some cases you just can't just the # operator, so for some things string.len might be better. |
|
|
| Report Abuse |
|
|
cygorx
|
  |
| Joined: 09 Nov 2012 |
| Total Posts: 668 |
|
|
| 15 Dec 2012 07:37 AM |
| My apologies, *you just can't trust the # operator. |
|
|
| Report Abuse |
|
|
| |
|