How do I get the left part of a text box.text

How do I get the left part of a text box.text???
Something like: textbox1.text.left(3) to get 'abc' if the text box contains the alphabeth.
But then the correct way
0
leonvr
3/22/2006 4:05:18 PM
asp.net.getting-started 91979 articles. 4 followers. Follow

3 Replies
880 Views

Similar Articles

[PageSpeed] 40

You can do something as:

string mainString = "abcdefg....";
string strSubString = mainString.SubString(0,2);

Hope this helps,

Regards


Bilal Hadiar, MCP, MCTS, MCPD, MCT
Microsoft MVP - Telerik MVP
0
haidar_bilal
3/22/2006 4:10:11 PM
Use the Substring() method.

string tempstring = TextBox1.Text.Substring(0,3);

0
jcasp
3/22/2006 4:13:00 PM
thanks all
0
leonvr
3/22/2006 5:35:15 PM
Reply:

Similar Artilces:

How do I get the Text of a Text ....
That may sound confusing, but I need to get the text of a Dynamically created text object. For each row the Text objects text might be somthing different, and when I loop through all the rows, I need to see if any of them are a certain Word. When I used Getitemstring, it doesn't like it. dw_1.Describe( 'text_control.text' ) will give you the .text attribute of a text control in a datawindow. How are you getting different values for the .text attributes on different rows? Using an expression or something? -- Paul Horan[TeamSybase] VCI Springfield, MA www.v...

how can i bind the first part of e_mail in one text-box and second part means after @ part in another text-box?
i have tried but i got failure.I have tried to bind e-mail from database into textbox but now i want to separate first part of e_mail before @ in one text-box when i will enter data in one text-box and after @ part it should go to another text-box automatically. If you can access it from codebehind you just need to perform a .Split("@") on the emailstring and assign index 0 to one textbox and index 1 to the other....

length or trim ? how can i get textbox.text as text that publichouse to textbox.text as text that public ?
hello friends length or trim ? how can i get textbox.text as text that publichouse to textbox.text as text that public ? second example is ..... textbox1.text is greenhouse.. i want to get green from textbox.text cheer Mark as me if my question or my answer can be helpful for you :) Hi,you can always perform a Trim to a retrieved string to delete the leading and trailing space characters. For your second example where you want to gt a part of the retrieved string you can use the SubString method of the String class.Grz, Kris. Read my blog. Handy Firefox plugins for web developers.Workar...

How can I get the text box.text property of my usercontrol textbox
 I had created a numeric textbox using windows control library and when I added the  text box in my project I cannot get the textbox.text property, How can I get the text box.text property of my usercontrol textbox Thanks in advance Regards Anu Palavila Hi, Do you have this code in your User control? <DefaultProperty("Text"), ToolboxData("<{0}:BaseTextBox runat=server></{0}:BaseTextBox>")> _Public Class TextField    Inherits TextBox ../sara...

cant get text of text box when it dissabled(value changed by javascript)
hi I cant get the text property of texbox properly, if its dissabled. I can get the value if i changed it with server script but i cant get  value when i tried to change the value by client side script(javascript)    this works for me:  <html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <script type="text/javascript">window.onload = function(){ var textbox = document.getElementById('<%= MyTextBox.ClientID %>'); // change value from the textbox ...

Dropdown selected index and text box text not getting reflected on web page
 Hi All,I have to bind the pre inserted data to the web page.Page has drop down lists and text boxes.I am using the following methods to bind these controls: 1. Drop down list:                            int index = dropDownList.Items.IndexOf(dropDownList.Items.FindByValue(value));                                 dropDownList.SelectedIndex = ind...

How do I block a user from entering text in a text box if they type text in another text box?
I have two text boxes, and want the user to complete one or the other.  How can I "grey out" one text box if a user starts typing in the other textbox?  Never make important decisions on a Monday! You can use the OnTextChanged event of the textboxes and write Javascript for both textboxes to disable the other textbox when the user starts to type in something in one textbox. The only problem with that is that once the user starts to type in something in one text box the other textbox gets disabled and locks up, so now the user HAS TO compulsarily type what he wants in th...

VB .net Web Form will not get contents of Text Box
I have created a web form with text boxes that are bound to a DataSet/DataView.  I have created button to navigate up and down the recordset.  That all works fine. I need to have the ability to edit/add text in any of the boxes and then when clicking "Save" button, it would build an UPDATE query to send to the database. When the Save button is clicked, I have coded to DIM a string var (strSQL) to use to build the SQL command.  For some reason, it will only get the text from a text box if the data was pulled the database.  If I add/edit data, then the SQL command will ha...

DOM, how to get text out of text node
Hi all, i am stack on this: i am parsing a dom document, i reach a text node, but i can't get the text out of the text node. Hope some one can help. this is the code: childs is a nsIDOMNodeList. PRUint32 len, i; childs->GetLength( &len ); nsCOMPtr<nsIDOMNode> child; nsEmbedString name; nsEmbedString value; PRUint16 type; for( i = 0; i < len; i++ ) { childs->Item( i, getter_AddRefs( child ) ); child->GetNodeType( &type ); child->GetLocalName( name ); ...

Copy web text fr FF2 PASTE to outlook text mail msg get an attachment not text
I never had this problem with IE. When I copy text from a web page and try to paste it as text into an Outlook2000 TEXT mail message, it instead is rendered into an attachment to the message. I just want to paste the text. Does anyone know why this happens, better yet - how to fix it? Currently I have to past the text into a text editor, and then recopy that into my Outlook mail message. This is getting old fast. Thanks in advance. Sandalls On 2/23/2007 5:01 PM On a whim, Sandalls pounded out on the keyboard > I never had this problem with IE. > > When I co...

Bold Text For Selected text in Text Box
Hi EveryoneI have a small thing to do [at this time , very big for me]. I want to make some text string as bold which appears in a text box control for the web. It means some of the portion of the string will be bold and some will be in the normal font style. Can anyone suggest any idea to accomplish this task. [I know that we can set the font weight property for the whole text box and all the text appears in the selected font-weight]Any suggestions.BaberBaber SaeedSoftware EngineerPalmChip, Pakistan Toll Free: 0800-000-13 Ext:494Cell: 0300-6438634 Standard TextBox that comes with ASP.NET ...

Getting Text Between Two Words In Text File
Hi everyone, Im just wondering what the best way to do this would be.I need to get a certain line of text from a number of text file records.This text lies between "-" and a </strong> tag. How would I go about this Thanks for your help! julie Use the File class to open and read your file and then use Regular Expression to find the specific word. References: File Class Regular Expression "I refuse to sign my posts with some clever quote said by some famous tech head in order to make myself seem more intelligent"-- Bill Gates...

How to get plain text of currently displayed text
I need to get text of currently displayed page from extension. var wm = Components.classes["@mozilla.org/appshell/window-mediator;1"] .getService(Components.interfaces.nsIWindowMediator); var mainWindow = wm.getMostRecentWindow("navigator:browser"); alert(mainWindow.getBrowser().selectedBrowser.contentDocument.getSelection().toString()) This returns only selected text. I need to get all text content but has no glue how to do this. Please help. Alex On Dec 17, 5:15=A0am, dzen <dze...@inbox.ru> wrote: > I need ...

How does text gets displayed in composer text field?
Hi, I'm new to TB dev. I stumbled upon this problem while trying to fix bug 309= 708. I am trying to figure out how does a message gets displayed in the com= poser window? I noticed that when I click edit on a mail in my drafts folde= r, the text in the uncompleted mail is displayed in the composer. I want to= do something similar to this. Does anyone know how does TB copy the text from the mail and display it on = the composer window? Is there like a textField.setText() to put the text into the composer's edi= ting text field? In another words, what function should i ca...

Web resources about - How do I get the left part of a text box.text - asp.net.getting-started

Jeb Bush wants to end the federal food stamp program
Republican presidential candidate Jeb Bush wants to get rid of the federal food stamp program as part of his overhaul of the country's welfare ...

North Korea celebrates nuclear test with coordinated dancing in the streets
To celebrate their country's purported "successful hydrogen bomb" test earlier this week, North Koreans gathered in the country's capital for ...

Tencent's Latest Tech Innovation; Live HD Video Streaming via Drone
China Business News Tencent's Latest Tech Innovation; Live HD Video Streaming via Drone China Business News Tencent Holdings Ltd. (OTCMKTS:TCEHY) ...

These are the new faces of ‘Star Wars: The Force Awakens’
How amazing would it be to have Luke, Leia, Han Solo and the entire original Star Wars gang appear in more future episodes? Unfortunately, that’s ...

Fired St. Louis Cardinals Exec To Plead Guilty To Hacking Houston Astros Front Office
Sports-related chicanery often ends in suspensions and the occasional expulsion, but rarely does it rise to the level of actual crime. Then again, ...

T-Mobile buys naming rights to Las Vegas arena for $375M
T-Mobile has purchased the naming rights of a new arena in Las Vegas. The Las Vegas Review-Journal reports that T-Mobile (Nasdaq: TMUS) paid ...

Paris police station attacker identified by friends: investigation source
Paris (AFP) - The man shot dead by police after trying to storm a Paris police station brandishing a meat cleaver has been identified by friends ...

ISIS Ordered Militant in Syria to Kill His Mother, Activists Say
New York Times ISIS Ordered Militant in Syria to Kill His Mother, Activists Say New York Times BEIRUT, Lebanon — An Islamic State militant ...

FBI, NSA seek tech firms' help in war on terror at Silicon Valley meeting
It's no secret that the U.S. government wants the tech industry's help in waging its war on terror. What has been a secret, up till now, is ...

Here’s when HBO’s ‘Game of Thrones’ Season 6 will premiere
Season six of HBO’s beloved fantasy series “Game of Thrones” will premiere April 24, HBO announced overnight. The highly anticipated sixth season ...

Resources last updated: 1/8/2016 5:57:02 PM