Mercurial > octave
comparison src/utils.cc @ 3361:4f40efa995c1
[project @ 1999-11-19 21:19:37 by jwe]
author | jwe |
---|---|
date | Fri, 19 Nov 1999 21:19:44 +0000 |
parents | 87721841efd7 |
children | f37ca3017116 |
comparison
equal
deleted
inserted
replaced
3360:48bd8127e19b | 3361:4f40efa995c1 |
---|---|
511 | 511 |
512 return retval; | 512 return retval; |
513 } | 513 } |
514 | 514 |
515 DEFUN (undo_string_escapes, args, , | 515 DEFUN (undo_string_escapes, args, , |
516 "undo_string_escapes (STRING)") | 516 "-*- texinfo -*-\n\ |
517 @deftypefn {Built-in Function} {} undo_string_escapes (@var{s})\n\ | |
518 Converts special characters in strings back to their escaped forms. For\n\ | |
519 example, the expression\n\ | |
520 \n\ | |
521 @example\n\ | |
522 bell = \"\\a\";\n\ | |
523 @end example\n\ | |
524 \n\ | |
525 @noindent\n\ | |
526 assigns the value of the alert character (control-g, ASCII code 7) to\n\ | |
527 the string variable @code{bell}. If this string is printed, the\n\ | |
528 system will ring the terminal bell (if it is possible). This is\n\ | |
529 normally the desired outcome. However, sometimes it is useful to be\n\ | |
530 able to print the original representation of the string, with the\n\ | |
531 special characters replaced by their escape sequences. For example,\n\ | |
532 \n\ | |
533 @example\n\ | |
534 octave:13> undo_string_escapes (bell)\n\ | |
535 ans = \\a\n\ | |
536 @end example\n\ | |
537 \n\ | |
538 @noindent\n\ | |
539 replaces the unprintable alert character with its printable\n\ | |
540 representation.\n\ | |
541 @end deftypefn") | |
517 { | 542 { |
518 octave_value retval; | 543 octave_value retval; |
519 | 544 |
520 int nargin = args.length (); | 545 int nargin = args.length (); |
521 | 546 |