CabConModding
Facebook
Twitter
youtube
Discord
Contact us
RSS
Menu
CabConModding
Home
New
Top
Premium
Rules
FAQ - Frequently Asked Questions
Games
Fornite
Call of Duty: Black Ops 3
Clash of Clans
Grand Theft Auto 5
Apex Legends
Assassin’s Creed Origins
Forums
Premium
Latest posts
What's new
Latest posts
New profile posts
Latest activity
Members
Current visitors
New profile posts
Log in
Register
What's new
Premium
Latest posts
Menu
Log in
Register
Navigation
Install the app
Install
More options
Dark Theme
Contact us
Close Menu
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Illegally useful string conversations :D
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="Xeirh" data-source="post: 62177" data-attributes="member: 201981"><p>works pretty simple:</p><p> * action: iprintln( capitalize_string( "capitalize me please" ) );</p><p> * return: Capitalize Me Please</p><p></p><p> Now the cool stuff!</p><p></p><p> item, let's say a level._effect: "grenade_samantha_steal"</p><p> * action: iprintln( capitalize_string( string_convert( "grenade_samantha_steal", "_", " " ) ) );</p><p> * return: Grenade Samantha Steal</p><p></p><p> string_convert can remove underscores and replace with space and vice versa or any target character.</p><p></p><p>[SPOILER="capitalize string"]</p><p>[CODE]</p><p>capitalize_string( string ) {</p><p> string = strtok( string, " " );</p><p> for( a = 0; a < string.size; a++ )</p><p> string[ a ] = capitalize_first_letter( string[ a ] );</p><p> capitalize_string = "";</p><p> for( a = 0; a < string.size; a++ )</p><p> if( a < string.size - 1 )</p><p> capitalize_string += string[ a ] + " ";</p><p> capitalize_string += string[ string.size - 1 ];</p><p> return capitalize_string;</p><p>}</p><p>capitalize_first_letter( string ) {</p><p> capitalize_letter = "";</p><p> capitalize_letter += toupper( string[ 0 ] );</p><p> if( string.size <= 1 )</p><p> return capitalize_letter;</p><p> for( a = 1; a < string.size; a++ )</p><p> capitalize_letter += string[ a ];</p><p> return capitalize_letter;</p><p>}</p><p>[/CODE]</p><p>[/SPOILER]</p><p>[SPOILER="string convert"]</p><p>[CODE]</p><p>string_convert( string, target, replace ) {</p><p> convert = "";</p><p> for( a = 0; a < string.size; a++ ) {</p><p> if( string[ a ] == target )</p><p> convert += replace;</p><p> else</p><p> convert += string[ a ];</p><p> return convert;</p><p> }</p><p> }</p><p>[/CODE]</p><p>[/SPOILER]</p><p>[SPOILER="Uppercase and Illegal check"]</p><p>[CODE]toupper( string ) {</p><p> lower = "abcdefghijklmnopqrstuvwxyz";</p><p> upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ";</p><p> for( a = 0; a < lower.size; a++ ) {</p><p> if( illegal_character( string ) )</p><p> return string;</p><p> if( string == lower[ a ] )</p><p> return upper[ a ];</p><p> }</p><p> return string;</p><p>}</p><p>illegal_character( string ) {</p><p> illegal = "*{}!^/-_$&@#()";</p><p> for( a = 0; a < illegal.size; a++ )</p><p> if( string == illegal[ a ] )</p><p> return true;</p><p> return false;</p><p>}[/CODE]</p><p>[/SPOILER]</p><p>[ATTACH=full]4761[/ATTACH]</p><p>[ATTACH=full]4763[/ATTACH]</p><p></p><p>*Converters Created By Boy7* <- the warrior</p></blockquote><p></p>
[QUOTE="Xeirh, post: 62177, member: 201981"] works pretty simple: * action: iprintln( capitalize_string( "capitalize me please" ) ); * return: Capitalize Me Please Now the cool stuff! item, let's say a level._effect: "grenade_samantha_steal" * action: iprintln( capitalize_string( string_convert( "grenade_samantha_steal", "_", " " ) ) ); * return: Grenade Samantha Steal string_convert can remove underscores and replace with space and vice versa or any target character. [SPOILER="capitalize string"] [CODE] capitalize_string( string ) { string = strtok( string, " " ); for( a = 0; a < string.size; a++ ) string[ a ] = capitalize_first_letter( string[ a ] ); capitalize_string = ""; for( a = 0; a < string.size; a++ ) if( a < string.size - 1 ) capitalize_string += string[ a ] + " "; capitalize_string += string[ string.size - 1 ]; return capitalize_string; } capitalize_first_letter( string ) { capitalize_letter = ""; capitalize_letter += toupper( string[ 0 ] ); if( string.size <= 1 ) return capitalize_letter; for( a = 1; a < string.size; a++ ) capitalize_letter += string[ a ]; return capitalize_letter; } [/CODE] [/SPOILER] [SPOILER="string convert"] [CODE] string_convert( string, target, replace ) { convert = ""; for( a = 0; a < string.size; a++ ) { if( string[ a ] == target ) convert += replace; else convert += string[ a ]; return convert; } } [/CODE] [/SPOILER] [SPOILER="Uppercase and Illegal check"] [CODE]toupper( string ) { lower = "abcdefghijklmnopqrstuvwxyz"; upper = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"; for( a = 0; a < lower.size; a++ ) { if( illegal_character( string ) ) return string; if( string == lower[ a ] ) return upper[ a ]; } return string; } illegal_character( string ) { illegal = "*{}!^/-_$&@#()"; for( a = 0; a < illegal.size; a++ ) if( string == illegal[ a ] ) return true; return false; }[/CODE] [/SPOILER] [ATTACH type="full" alt="Capture_1.PNG"]4761[/ATTACH] [ATTACH type="full" alt="Capture.png"]4763[/ATTACH] *Converters Created By Boy7* <- the warrior [/QUOTE]
Verification
Post reply
Forums
Gaming
Call of Duty Classics
Call of Duty: Black Ops 2
Call of Duty: Black Ops 2 Mods and Scripts
Call of Duty: Black Ops 2 Scripts
Illegally useful string conversations :D
CabConModding is now on facebook! Check the latest Updates, the Site Status and much more now!
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.
Accept
Learn more…
Top