473,698 Members | 2,411 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

transfer textbox text to a string arry?

I have asked this before, but the offered solution did not work.
I want to have a command button, that transfers any text from a textbox
to a variable which is an array. so that i can print out single letters
of the text.
e.g. if i have "hello" in the textbox and i print out the forth letter
it should list "l"....
can someone tell me howto?

Nov 20 '05 #1
3 1944
"Coffee" <th**********@h otmail.com> schrieb
I have asked this before, but the offered solution did not work.
I want to have a command button, that transfers any text from a
textbox to a variable which is an array. so that i can print out
single letters of the text.
e.g. if i have "hello" in the textbox and i print out the forth
letter it should list "l"....
can someone tell me howto?


The text of the textbox is returned by it's text property. The type is
"String". A string object offers a chars property.
--
Armin

Nov 20 '05 #2
* Coffee <th**********@h otmail.com> scripsit:
I have asked this before, but the offered solution did not work.
I want to have a command button, that transfers any text from a
textbox to a variable which is an array. so that i can print out
single letters of the text.

e.g. if i have "hello" in the textbox and i print out the forth letter
it should list "l"....


'MsgBox(Me.Text Box1.Text.Chars (3))'.

--
Herfried K. Wagner
MVP · VB Classic, VB.NET
<http://www.mvps.org/dotnet>
Nov 20 '05 #3
Cor
Hi Coffee,
I have asked this before, but the offered solution did not work.
I want to have a command button, that transfers any text from a textbox
to a variable which is an array. so that i can print out single letters
of the text.
e.g. if i have "hello" in the textbox and i print out the forth letter
it should list "l"....
can someone tell me howto?


A lot of Coffee today.

In addition from the other answers. The textbox.text is a string. A string
is in itself an array of characters.

You get something out of that using VB string functions or Net string
members.

The index start at 0 so the 4th character is 3.

Using a string member it will be your example is the fouth letter
textbox1.text.s ubstring(3,1). 4 character with a length of 1.

When you want to use a single character, use the char, do you want a part of
the string then substring.

Cor

Nov 20 '05 #4

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

Similar topics

13
6292
by: Chapman | last post by:
Some questions about strings: this is the extracted piece of my test code: /** **/ char *arry; arry = malloc(30*sizeof(arry)); arry = 'B'; arry = 'S'; arry = 'c';
0
1174
by: Andrew | last post by:
Can someone out there help. I am using Server. Transfer from a user control to a webform and tried to follow many examples exactly as specified but cannot get around the (Specified cast is not valid.) ERROR which happens on the second page Search.aspx on the line with (PrevPageValues = (FirstPage)Context.Handler;). I have also got <%@ Reference Page="_FirstPage.ascx" %> at the top of the second page.
5
3750
by: Nedu N | last post by:
Hi All, I am facing a typical problem in my .NET application with the pop-up script messages. The thing is that its working fine when i run on my development machine but not running in expected manner when i move it to Prod environment. Please have a look at the following code snippet... //Page name - Add.aspx private void Page_Load(object sender, System.EventArgs e)
2
3375
by: Pete | last post by:
Hi all... I sincerly hope one of the MS guys can clear this up for me... First some background... Ok, I have a web site which is fully translatable into several languages. All the strings for the web site are held in a database and all the labels, buttons etc are populated at run time in the Page_Load handler. The retreval of the strings from the database is all
4
2304
by: ewolfman | last post by:
Hi, This may sound a little complicated, but here goes: I have 2 webforms (lets call them 'x' and 'y'). * - 'x' is a form which contains a single server side TextBox web control, and an iframe. The iframe's src attribute references the 'y' webform.
9
11015
by: tawright915 | last post by:
I want to convert a byte array to a string or text to write it out in a multiline textbox. I've tried encoding, and converting but end up with nothing in the textbox. The strange thing is that it writes out fine to a text document using StreamWriter. So I have this tcp/ip app that receives everything into a byte array. I then want to write out what it was that was passed to me, into a multiline textbox.
3
1567
by: decren | last post by:
Hello, I have a form with 4 tables. Table 1 & 2 are not associated with my problem so I'll start with Table3. Table3 contains an input-textbox; and a push-button to add a new row to Table4. The button also activates a script to transfer the information in the text-box to the new cell in Table4. I originally used cloneNode which works fine: // cell 1 - input text document.getElementById("Table3"); var...
2
3696
by: chirag1989 | last post by:
i have created an arry of text box now i want to retrieve the values of each text box so as to insert them in data base can anyone help how can i retrieve the values of array of textbox and store it in other array Code Of creating text box array <%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <form action="ext1.asp" method="post"> <%for i=0 to 4 response.write "<input type=text name=txt id="&i&" ><br>"
21
3948
by: imtmub | last post by:
I have two page one is parent and child. Parent page has text field and command button. The Link button open a child page as a popup. Child page as Text box and Button. when i click the button it will transfer child textbox data parent page text box. this is working fine when i use normal page(Not using master page on it). Parent page aspx: <asp:TextBox ID="TextBox1" runat="server" AutoPostBack="True"></asp:TextBox> <a href="#"...
0
8604
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9160
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8897
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
7729
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
4370
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4619
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2331
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2002
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.