Computer Science Canada Advanced string manipulation: Help needed |
Author: | echeese [ Sat Nov 22, 2003 6:49 pm ] |
Post subject: | Advanced string manipulation: Help needed |
Hello, all, I need commands for string manipulation. Please post all the ones you can think of. If there's one like PHP's explode, post it as well, or something that can get the x'th word from a string like getword("This is a test, ok?", 3, " ") would return "test," |
Author: | thoughtful [ Sat Nov 22, 2003 6:58 pm ] | ||
Post subject: | string manupulation | ||
you can use something like this
|
Author: | echeese [ Sat Nov 22, 2003 7:05 pm ] |
Post subject: | |
Yes, but what if you don't know the length of the word, or even how many words there are? |
Author: | Tony [ Sat Nov 22, 2003 9:03 pm ] | ||
Post subject: | |||
to get the length of the string, you can use
use substrings to find spaces and break sentance into separate words. you can ether use variableName(index) method or index() |
Author: | Andy [ Sun Nov 23, 2003 3:37 pm ] | ||
Post subject: | |||
to check the number of words:
|
Author: | Homer_simpson [ Sun Nov 23, 2003 6:36 pm ] | ||
Post subject: | |||
how bout a nice function for it?
|
Author: | echeese [ Tue Nov 25, 2003 8:28 am ] |
Post subject: | |
Thank you Homer... By the way, this is for my next Net project... It's a 3 letter word with the first letter I, last is C and it's full of R... ![]() Argh!!! I'm glad I didn't submit this post... Is there a way using Net to read more than 255 chars? Server sends me a string > 255 chars |
Author: | Tony [ Tue Nov 25, 2003 11:16 am ] |
Post subject: | |
i belive homer wrote a net server app that accepts 255+ characters. You should take a look at that - its here |
Author: | echeese [ Wed Nov 26, 2003 11:13 am ] |
Post subject: | |
lol, that's my server, with Homer's addons ![]() |
Author: | Dan [ Wed Nov 26, 2003 12:35 pm ] |
Post subject: | |
echeese wrote: lol, that's my server, with Homer's addons
![]() in turing? ![]() |
Author: | echeese [ Mon Dec 01, 2003 11:15 am ] |
Post subject: | |
Hacker Dan: Yes. In Turing... I decided to actually make it a client. Check it out under submissions. |
Author: | Dan [ Tue Dec 02, 2003 5:35 pm ] |
Post subject: | |
wow, you shure got crazy ideas for turings net comands. why not check out c++ ? you get alot more power and fuctionaliy out of it and it has some nice netwrok related librablerys |
Author: | DanShadow [ Sun Dec 07, 2003 7:49 pm ] | ||
Post subject: | .. | ||
Advanced String Manipulation...hmm, well if you want to do it the advanced way, use the almighty 'ord' command, and ascii codes. This code works out if you want to be very detail specific to characters put in, cast sensitiveness, checking all letters in a word, checking words, etc. [ I dont know why, but it cuts out the last two letters, ![]()
|