🔒 This topic is solved and locked.
Need further help from the community? Please
sign in and ask a new question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Posted 12-04-2013 01:07 PM
(4295 views)
What's a quick way to replace em dashes with en dashes in a text string?
data have;
informat text_string $30.;
format text_string $30.;
input text_string $;
cards;
This—is_my_string_em_dash
This-has_a_normal_dash
This-is_another_em—dash
Another_normal_-_dash
;
run;
1 ACCEPTED SOLUTION
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
in the code you posted emdash is '97'x
translate(text_string,'-','97'x)
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
TRANSLATE function.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Ok...it shows as EM Dash in text but I guess its actually something else, because that works in example above, but not real data.
Hex4 of 9620
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
in the code you posted emdash is '97'x
translate(text_string,'-','97'x)