Re: String Character Conversion



Eric Sosman wrote:

Aha! I think I may have (*may* have) figured out
your difficulty. When you say the string as read is
"Needle\n\n", do you mean that there are ten characters
before the zero, the last four of which are "backslash,
n, backslash, n?" And that what you want is an eight-
character string ending in "newline, newline?"

That is exactly my difficulty. The string is ten characters and in order to do the string comparison, I need it ending in "newline newline".

Your program, it seems, wants to use a similar
convention to represent "difficult" characters. If
that's what you're after, you'll need to write your
own translation code. Depending on how many of the C
source forms you decide to accept, the size of this
project could be anywhere from trivial to smallish.

That's what I was fearing. Oh well, maybe this lil' gotcha is why it is part of the homework.

Thanks for your assistance and to the other folks who replied.


.



Relevant Pages

  • Re: Prothon should not borrow Python strings!
    ... """It does not make sense to have a string without knowing what encoding ... same cul de sac as Python. ... Prothon_String_As_ASCII // raises error if there are high characters ... Python's split between byte strings and Unicode strings is ...
    (comp.lang.python)
  • Re: Letter to US Sen. Byron Dorgan re unpaid overtime
    ... put them in stupid places. ... Programming is difficult (as you must surely appreciate, ... > strings will be in the range 1...1000 characters. ... impose an artificially small limit on string length." ...
    (comp.programming)
  • Re: Byte Array to String
    ... retrieved text will mismatch the original characters. ... encoding the characters. ... Dim strFileData as String ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: A note on personal corruption as a result of using C
    ... impossible to write effective string validation routines by definition ... (Note that a string literal may contain embedded null characters; ... without resorting to abusive language. ... In practice, programmers typically use "struct" ...
    (comp.programming)
  • Re: Self-Documenting Code Contest
    ... self-documenting. ... query:= 'documenting' asSortedCollection. ... string size < query size ... two words becomes a set of Characters. ...
    (comp.lang.smalltalk)