Menu

how to get substring

Anonymous
2011-09-27
2015-07-27
  • Anonymous

    Anonymous - 2011-09-27

    is there a  substring method in bstring library?
    How to get sub string?

     
  • Paul Hsieh

    Paul Hsieh - 2015-07-27

    In the C API you would do this as follows:

    bstring orgstr, newstr;
    ...
    bassignmidstr (newstr=bfromcstr(""), orgstr, start, length);
    

    Or, if you just need a reference:

    bstring orgstr;
    struct tagbstring newrstr;
    ...
    bmid2tbstr (newrstr, orgstr, start, length);
    

    In the C++ API you would do this as follows:

    CBstring orgstr;
    struct tagbstring tmp;
    ...
    bmid2tbstr (tmp, orgstr, start, length);
    CBString newstr(tmp);
    
     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.