|
Hi Friends
I have one doubt using "substring"..
For example
i need to split the words..
i contain 50 words get in one string..
string str1-> get 50 character..
string str=str1.substring(0,25).
string strs=str1.substring(25,30).
but here "string strs" get 1 to 30 character..
I need only 5 characetr in "string strs"..
how can i achive this
regards
saravanan
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
|
This is an ASP.NET forum. C# has its own exclusive forum. Hence this should actually default to JavaScript.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
saravanan05 wrote: string str=str1.substring(0,25).
You had asked for length 25 and hence it had returned that much. If your intention was only 5, can you put 5 as the second argument.
Vasudevan Deepak Kumar
Personal Homepage Tech Gossips
A pessimist sees only the dark side of the clouds, and mopes; a philosopher sees both sides, and shrugs; an optimist doesn't see the clouds at all - he's walking on them. --Leonard Louis Levinson
|
|
|
|
|
i use like this..it is not working
string str = "saravanakumarvedhagirijayaprakash";
string str2 = str.Substring(0, 15);
string str3 = str.Substring(15, 20);
Known Is Drop.Unknown Is Ocean
|
|
|
|
|
Did you not listen to what you were told? The second argument indicates the number of characters to fetch. If you specify a value of 30, 30 characters will be fetched from the specified start position.
BTW, this is the kind of question that you could have answered yourself if you had consulted the documentation[^].
Paul Marfleet
"No, his mind is not for rent
To any God or government"
Tom Sawyer - Rush
|
|
|
|
|
Hi Friends,
I have one doubt,suppose i m having two text boxes and one button that is search button when i enter the id corresponding data should display in another textbox we have used by database query,but how to do using XML,Can anyone help me please?
Thanks & Regards
Senthil Kumar
|
|
|
|
|
If you want to use XML to store data, you'd search it with XPath
Christian Graus - Microsoft MVP - C++
"also I don't think "TranslateOneToTwoBillion OneHundredAndFortySevenMillion FourHundredAndEightyThreeThousand SixHundredAndFortySeven()" is a very good choice for a function name" - SpacixOne ( offering help to someone who really needed it ) ( spaces added for the benefit of people running at < 1280x1024 )
|
|
|
|
|
I am working on SEO based project. how can I find reciprocal url from my site. (searching my website name in reciprocal URL)
|
|
|
|
|
swguy23 wrote: (searching my website name in reciprocal URL)
Use HTTPWebRequest class to send a request to reciprocal URL, get the Response and use Regular expressions to find a match.
|
|
|
|
|
Is it possible without using Datatable, dataset or datareader , retrive
records from database. We can use SqlConnection. Can we retrive using System.Object array. Try read whole databas ,from table retrive one record and display or modify
|
|
|
|
|
Dharti Gajjar wrote: from table retrive one record and display or modify
ExecuteScalar() ?
|
|
|
|
|
but to retrive all records , not one row from databse,but retive table it's row
from database and store into system object array
|
|
|
|
|
Why do you want to do this ? You can feth data into any of these (Reader/Datatable), and loop through each rows and put it in an array.
|
|
|
|
|
please tell me the code for the upload the file in the server root path
|
|
|
|
|
Please don't create multiple post for the same question.
Apurva Kaushal
|
|
|
|
|
hi frd...this is code for upload image.....
string sPath;
sPath="../Images/Logo.jpg";
if(BuildersLogoFile.PostedFile!=null)
{
HttpPostedFile photoFile=BuildersLogoFile.PostedFile;
int photoLength=photoFile.ContentLength;
string fileName=Path.GetFileName(photoFile.FileName);
if(photoLength==0)
{
Label1.Text="There was not any file uploaded";
return;
}
if(File.Exists(Server.MapPath(sPath+fileName)))
{
Label1.Text="File already exists";
return;
}
if(Path.GetExtension(photoFile.FileName).ToLower()!=".jpg")
{
Label1.Text="The file must have extension of JPG";
return;
}
byte[] myData=new byte[photoLength];
photoFile.InputStream.Read(myData,0,photoLength);
int file_append=0;
while (System.IO.File.Exists(Server.MapPath(sPath + fileName)))
{
file_append++;
fileName = System.IO.Path.GetFileNameWithoutExtension(photoFile.FileName) + file_append.ToString() + ".jpg";
}
FileStream newFile=new FileStream(Server.MapPath(sPath+fileName),FileMode.Create);
newFile.Write(myData,0,myData.Length);
newFile.Close();
buildersClass.BuildersLogo=sPath+fileName;
}
Vijay
|
|
|
|
|
iam setting a grid view in a panel and iam having a text box when i enter some text in the text box i wrote a code in a such a way that the text box value should come in the grid view..by using view state its working fine ..and the iam viewing the last genarated row of the grid view ..but the pproblem was when grid view becomming larger the scroll bar of panel is appearing and iam uanable to view the last genarated row its going down in the pannel...how this problem solve...will some one help for me...plz
|
|
|
|
|
jagadeeshkumar2106 wrote: iam uanable to view the last genarated row its going down in the pannel..
How come you are not able to view?? You mean, you don't want to scroll down to view the last row?? then, you can set the scroll position of your DIV from Javascript.
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
my intension is the grid view row is added at the last and it is coming from the top of the panel ...is there is any way to come from the bottom of the panel and the auto genarate to come at the top...
|
|
|
|
|
As Apurva suggested, you can sort your data in descending order. or try to insert the new row at the top of your datatable. (dt.Rows.InsertAt() )
Thanks and Regards,
Michael Sync ( Blog: http://michaelsync.net)
"Please vote to let me (and others) know if this answer helped you or not. A 5 vote tells people that your question has been answered successfully and that I've pitched it at just the right level. Thanks."
|
|
|
|
|
dt.Rows.InsertAt() how to work with this will u help me plz
|
|
|
|
|
If you just want to see the last inserted record without scrolling then you can show that at first and it will be displayed at the top.
Apurva Kaushal
|
|
|
|
|
hi wat u said i think it will com but will u plz help how to get the grid in reverse order madam
|
|
|
|
|
You can sort your records based on the ID column (if you have) in descending order or by the created date again in descending order.
jagadeeshkumar2106 wrote: reverse order madam
I am a Male dude...
Apurva Kaushal
|
|
|
|