Jump to content
UBot Underground

Parsing a string into two variables


Recommended Posts

I have a string that I need to split into two variables.

 

The string contains a charactor that I could split it on, I just don't know how to specify this in the editor.

 

Something like

 

string line; //this  is my string to parse

 

int i = line.indexOf('|');

string a = line.substring(0,i);

string b = line.substring(i,line.length-i);

 

Link to post
Share on other sites

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.   Paste as plain text instead

  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.

Loading...
×
×
  • Create New...