Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

String.IndexOf in C#

0 views
Skip to first unread message

h u x u.nospa.m@reverseme.laimoth.moc Chu Xu

unread,
Mar 12, 2002, 2:19:49 PM3/12/02
to
Does IndexOf work for DBCS strings? I want to check if a string contains the
following string:

DEU: كüنِضؤـ JPN: f[f\f]f^f{f|f}fAfa,پ,`Y@Y~Y?Yü ENU: Hello World

Thanks,

Chu

h u x u.nospa.m@reverseme.laimoth.moc Chu Xu

unread,
Mar 12, 2002, 3:08:34 PM3/12/02
to
Okay, so I was told that all strings in .NET are Unicode and hence IndexOf
doesn't deal with ANSI strings.

Now another quesiton, how to do a strstr() for ANSI string in .NET?

Thanks,
Chu

"Chu Xu" <c h u x u.no...@reverseme.laimoth.moc> wrote in message
news:enOlOrfyBHA.2128@tkmsftngp07...

Nicholas Paldino [.NET MVP]

unread,
Mar 12, 2002, 3:12:00 PM3/12/02
to
Chu,

You can use the IndexOf method on the instance of the string to find the
occurence of another substring.

Hope this helps.

--
- Nicholas Paldino [.NET MVP]
- nicholas...@exisconsulting.com

"Chu Xu" <c h u x u.no...@reverseme.laimoth.moc> wrote in message

news:OgkrdGgyBHA.1976@tkmsftngp05...

Bruce Barker

unread,
Mar 12, 2002, 3:33:20 PM3/12/02
to
look at the ANSI Encoding/Decodeing routines (System.Text namespace) for
routines to convert your DBCS data to Unicode and back. other than the
encoders/decodes, there is no dbcs support in .net


-- bruce

"Chu Xu" <c h u x u.no...@reverseme.laimoth.moc> wrote in message

news:OgkrdGgyBHA.1976@tkmsftngp05...

0 new messages