Jump to content

[SOLVED] Break Apart Strings


proggR

Recommended Posts

Is there anyway to break apart a string into groups? I have a string thats formatted DATE_COURSE_TITLE and i was wondering if there's a function that can grab any characters after the second underscore?

And I don't need this to use but for knowledge sake, is there anyway to grab just between the two underscores as well? I'm guessing something like:

 

$i = 0

if (character == "_"){

getcharacter;

if (character == "_"){

$word = $buffer;

}

else{

$buffer[$i] = getcharacter;

$i = $i+1;

}

 

would work but i was wondering if there was a function that would do it. even if i have to find the placement of each underscore and just feed start and end points into the function or something. althought i guess i could write that myself.

anyway. i'm rambling because I'm in a hurry. Thanks in advance.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.