Highlighted
New Member.
3193 views

Split and concatenate after removing the delimiter in VuGen

Hi

I am having a string x="123 456"

I have to remove the space between the number and get the final output as "123456" in VuGen

Please help me

regards

PINNK

0 Likes
3 Replies
Highlighted
Absent Member.
Absent Member.

Re: Split and concatenate after removing the delimiter in VuGen

This is pretty basic C coding which, again, could be solved by simply googling - http://stackoverflow.com/questions/15444567/removing-spaces-and-special-characters-from-string

Highlighted
Super Contributor.
Super Contributor.

Re: Split and concatenate after removing the delimiter in VuGen

Hello,

use stringtokenizer function....below is the code

char name[]="123 456";
    char * token;
    char name1[30];
    
    token=(char *)strtok(name," ");
    //lr_save_string(token,"token1");
    strcat(name1,token);
    token=(char *)strtok(NULL," ");
    //lr_save_string(token,"token2");
    strcat(name1,token);
    lr_output_message(name1);

Thanks,

Ravi kumar

 

0 Likes
Highlighted
Acclaimed Contributor.
Acclaimed Contributor.

Re: Split and concatenate after removing the delimiter in VuGen

>token=(char *)strtok(name," ");

 

If you have to cast the result of strtok, you're doing something wrong.

Make sure you include string.h

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.