Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Newcomers AppGameKit Corner / Remove character from a string

Author
Message
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 17th Jan 2018 10:28
This function will remove all of a specific character from a string


For example: RemoveChar( mystring, 9 ) would remove all tabs from mystring, or RemoveChar( mystring, 34 ) would remove all quotes.

If you would like to pass a actual char to it you could always use Asc for example: RemoveChar( mystring, Asc( "*" ) ) would remove all stars from mystring
-EdzUp
Bengismo
7
Years of Service
User Offline
Joined: 20th Nov 2017
Location: Yorkshire, England
Posted: 17th Jan 2018 11:54 Edited at: 17th Jan 2018 14:53
There is a built in function for this

string StripString( str, chars )

If you want to strip whole words, replace words or characters then there is also ReplaceString()...

parseme = ReplaceString( parseme, notme, "", -1 )
puzzler2018
User Banned
Posted: 17th Jan 2018 17:54 Edited at: 17th Jan 2018 17:54
i have been cut short from making little functions only to find that there are commands that do them..

like - str("ff0000ff",16) will return the decimal code for that hexidecimal

ya not the only one, just a matter of ploughing through the commands list and understanding how they work

Good learning practice making our own though

Good effort
EdzUp
22
Years of Service
User Offline
Joined: 8th Sep 2002
Location: UK
Posted: 19th Jan 2018 09:19
Weirdly enough I looked in the string section of the help docs and didn't see stripstring anywhere
-EdzUp
PHeMoX
6
Years of Service
User Offline
Joined: 9th Jan 2018
Location:
Posted: 3rd Feb 2018 22:24
Quote: "ya not the only one, just a matter of ploughing through the commands list and understanding how they work"


Yeah, it would be neat if we could search the online help pages with some kind of advanced search function.

Because there's also quite a lot of valuable code examples in many of the build-in functions, but some exist only in GetObjectX but not in GetObjectY or GetObjectZ , when the actual code is useful and relevant to all axes lol.

That's of course aside from quite a bunch of functions that have very little to no comments on how to use them or why, despite plenty of commands requiring other commands to be called in the right order. This is especially true for 2D and 3D physics commands. And it took me a while to find even a 'hint' to using Step3DPhysicsWorld() in the Do Loop , let alone how I need to create a physics world first using Create3Dphysicsworld(scalefactor) , even though the 2D physics equivalent requires no such things.
IronManhood
9
Years of Service
User Offline
Joined: 6th Feb 2015
Location: US
Posted: 4th Feb 2018 23:37
You could use google as an advanced search.
Phaelax
DBPro Master
21
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 5th Feb 2018 02:51
Quote: "Yeah, it would be neat if we could search the online help pages with some kind of advanced search function. "


I felt the same way awhile back. Therefore, I added every AppGameKit command to a database and implemented a basic search feature. It's not up to date, so any new commands in the past year probably won't show up, but I'd say over 90% is the same.

http://www.zimnox.com/resources/agk/docs/search.php
Tiled TMX Importer V.2
XML Parser V.2
Base64 Encoder/Decoder
Purple Token - Free online hi-score database
Legend of Zelda

"I like offending people, because I think people who get offended should be offended." - Linus Torvalds

Login to post a reply

Server time is: 2024-11-23 01:09:43
Your offset time is: 2024-11-23 01:09:43