I have an inkey code which accepts a name typed by a user into a string of length 30.Lets say I type a name of 20 characters and store it in this string. Then this string becomes 20 charcaters long automatically which is very annoying because I want it to retain its original length of 30 characters.
In short is there a way to dynamically resize a string to a certain length ?
regards zazang
I like good 'views' because they have no 'strings' attached..
The problem is that blank_str = str_create("#length"); creates a string of only 7 characters long. #, l, e, n, g, t, h = 7. The "#num" syntax only works with string initialization, and only with literals.
You could try: var length = str_len(my_str); length = 175 - length; int i = 0; for(i = 0; i < length; i++) {str_cat(my_str, " ");}