How to make a string random character case
Hello, how I can make a string in a random character case? I mean not that it's 2 options, one is lower case and second is upper, but I want all characters in my string to go random case, like:
this: This is a string to that: ThIs iS A STRiNG The string is stored in a variable named "g_TypeWord[128]" (sometimes it's less chars). Thank you for help ;) |
Re: How to make a string random character case
PHP Code:
|
Re: How to make a string random character case
charsmax(g_TypeWord) ?? not sizeof(g_TypeWord) ???
PHP Code:
|
Re: How to make a string random character case
Neither of these, use strlen.
Also, it would be better to use two constant arrays, one with uppercase symbols and one with lowercase, then change them. |
Re: How to make a string random character case
Yeah Yeah, considering if a somenone not using a g_TypeWord[128] chars size;
Work anyway |
Re: How to make a string random character case
What? If there's a string of 60 characters in 128 cell array, you will waste a lot of memory because you will be calling a native another 68 times for nothing.
It doesn't matter if it works, strlen should be used here no matter what. |
Re: How to make a string random character case
PHP Code:
|
Re: How to make a string random character case
This:
PHP Code:
Thank you everyone. |
| All times are GMT -4. The time now is 21:47. |
Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.