what are the examples of strtok which delimits the space and commas but also token the comma?
Favorite Answer
If I understand your question properly, you have a text which includes spaces and commas, and you want to tokenize the text using both the commas and the spaces as delimiters (i.e. you want the individual words) BUT, you want to include commas in the resulting tokens that were originally followed by a comma in the text.
If not all of the commas are followed by spaces, this will be difficult, as the tokenize function works in place and will replace the delimiter character with a null (thus terminating the string). In order to include the comma in the resulting token, you’ll need to ADD the required space first, so it can then be turned into a null.
You’re best bet is to convert all commas which are NOT followed by spaces to commas with a following space, and then use the STRTOK function using only the space character as a delimiter.
- Academic Writing
- Accounting
- Anthropology
- Article
- Blog
- Business
- Career
- Case Study
- Critical Thinking
- Culture
- Dissertation
- Education
- Education Questions
- Essay Tips
- Essay Writing
- Finance
- Free Essay Samples
- Free Essay Templates
- Free Essay Topics
- Health
- History
- Human Resources
- Law
- Literature
- Management
- Marketing
- Nursing
- other
- Politics
- Problem Solving
- Psychology
- Report
- Research Paper
- Review Writing
- Social Issues
- Speech Writing
- Term Paper
- Thesis Writing
- Writing Styles