473,387 Members | 1,650 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

CString.Right

I have a code
strDocExt=CString.Right(txtFileContents.PostedFile .FİleName,4).ToLower();

in c# CString.Right equal what?

Thanks.
Nov 15 '05 #1
3 8067
Two ways of doing this.

1) You could use the String.Substring [myStr.SubString(myStr.Length-4)] to
get the last N number of characters and compare it with the variable.
-- or --
2) Use the String.EndsWith method.

"Selen" <sk*****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a code
strDocExt=CString.Right(txtFileContents.PostedFile .FİleName,4).ToLower();

in c# CString.Right equal what?

Thanks.

Nov 15 '05 #2
I want to this:
mystring is "selen"

I write something and I take "en" the last two character...
"Peter Rilling" <pe***@nospam.rilling.net>, iletide şunu yazdı
news:%2****************@TK2MSFTNGP12.phx.gbl...
Two ways of doing this.

1) You could use the String.Substring [myStr.SubString(myStr.Length-4)] to get the last N number of characters and compare it with the variable.
-- or --
2) Use the String.EndsWith method.

"Selen" <sk*****@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
I have a code
strDocExt=CString.Right(txtFileContents.PostedFile .FİleName,4).ToLower();
in c# CString.Right equal what?

Thanks.


Nov 15 '05 #3
Selen <sk*****@yahoo.com> wrote:
I want to this:
mystring is "selen"

I write something and I take "en" the last two character...


string right = myString.Substring (myString.Length-2);

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 15 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Rajesh Garg | last post by:
Why and in what situations is CString not preferred? RVG
5
by: Tim Wong | last post by:
All: I am trying to convert a CString value to an unsigned char array. I found some code online that will allow me to compile, but when I try to print out...i get a whole mess. /*Begin Code*/...
25
by: Gareth | last post by:
I want to do the following to strings: 1) Check if first four characters are "DATA" 2) Get the middle 'word' from the following string "DATA 123 xyz" (the middle word is variable length) -...
1
by: bo bjerkeholt | last post by:
Just check that I got this right. I have an old DLL made in VC6 (no sources). Some of the methods have a CString as argument. No problem when using this from my VC6 application. I migrated my...
6
by: ATS | last post by:
INF: Has anyone made a CString, sprintf, and sscanf for .NET? Please help, I want to code with PURE .NET (i.e. pure CLR). No MFC, No ATL, no C-Run Time Library. But I want CString, sprintf,...
4
by: Susan Rice | last post by:
I'm new to using CString. Why won't the following compile? I'm using Microsoft Visual C++ 6.0 Line 37 which it complains about is the function: 37 CString ConvertFile(char *szFileName) I...
1
by: Tim Kelley | last post by:
I am new to Visual C++ and I am having difficulty parsing a string. We have a database that has a text field that contains multiple lines (seperated by a carriage return and new line characters). ...
6
by: meisterbartsch | last post by:
Hi NG, I have got a starting pointer of a char series (mxArrayToString(pa)). I also know the length (number of elements by mxGetNumberOfElements) I want to read. How do I get a Cstring from...
9
by: Donos | last post by:
I have a CString with 100 characters. Now i want to make that to 2 lines. For example, CString str = "This is just a test to find out how to break a cstring"; I want this CString in the...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.