how can i split sting in textbox in windows application using
c# .net

Answers were Sorted based on User's Feedback



how can i split sting in textbox in windows application using c# .net..

Answer / suresh

DropDown spliting numbers1-100,101-200,...901-1000

ddlnumbers.Items.Clear();
string s=ddlselct.SelectedItem.ToString();
string[] value = s.Split('-');

var v1 =Convert.ToInt32(value[0]);
var v2 =Convert.ToInt32(value[1]);

for (int i = v1; i <= v2; i++)
{
ddlnumbers.Items.Add(i.ToString());
}

Is This Answer Correct ?    4 Yes 0 No

how can i split sting in textbox in windows application using c# .net..

Answer / sasd

string s = in_txt.Text;
string[] a;
// Split string on spaces.
// ... This will separate all the words.
//
string[] words = s.Split(' ');
foreach(string word in words)
{
for (int i = 0; i <= 3; i++)
{
a[i] = word;
}

Is This Answer Correct ?    11 Yes 15 No

Post New Answer

More C Sharp Code Interview Questions

Write a function which accepts a sentence as input parameter.Each word in that sentence is to be reversed. Space should be there between each words.Return the sentence with reversed words to main function and produce the required output. for eg:- i/p: jack jill jung kill o/p: kcaj llij gnuj llik

1 Answers   Mind Tree,


Hello I am hosting remoting within IIS. Everything works just fine as long as I allow anonymous access at the IIS level. When I allow only Windows Authenticated sessions, something very strange happens: If the client activates the remote object with IP address - works fine If the client activates it using a machine name - get http 401 exception is thrown. The exception is thrown when the client calls the remote method. I set the channel's useDefaultCredentials property to true. Any idea how to allow Windows Authentication? Here is the call stack: System.Net.WebException: The remote server returned an error: (401) Unauthorized .. ---> System.ComponentModel.Win32Exception: The target principal name is incorrect at System.Net.NTAuthentication.GetOutgoingBlob(Byte[] incomingBlob, Boolean handshakeComplete) at System.Net.NTAuthentication.GetOutgoingBlob(String incomingBlob, Boolean handshakeComplete) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.DoAuthenticate(String challenge, WebRequest webRequest, ICredentials credentials, Boolean preAuthenticate) at System.Net.NegotiateClient.Authenticate(String challenge, WebRequest webRequest, ICredentials credentials) at System.Net.AuthenticationManager.Authenticate(String challenge, WebRequest request, ICredentials credentials) at System.Net.AuthenticationState.AttemptAuthenticate (HttpWebRequest httpWebRequest, ICredentials authInfo) --- End of inner exception stack trace ---

0 Answers   Infosys,


Create a class called Accounts which has data members like ACCOUNT no, Customer name, Account type, Transaction type (d/w), amount, balance D->Deposit W->Withdrawal If transaction type is deposit call the credit(int amount) and update balance in this method. If transaction type is withdraw call debit(int amt) and update balance. Pass the other information like Account no,name,Account Type through constructor. Call the show data method to display the values.

1 Answers   Cognizant,


I am developing a web application using google map api.I want to update the map inside the div control within update panel. I got other controls updated but map doesn't get updated.I do not not want to update map whenever unnecessary controls are fired at server side.How could it be achieved?

0 Answers  


Give the code for Handling Mouse Events?

0 Answers  






program to reverse the order of words in a string.

2 Answers   Mind Tree,


Write a function which accepts list of nouns as input parameter and return the same list in the plural form. Conditions: i) if last letter is r then append s ii) if word ends with y then replace it by ies iii) call this function in main() and produce the required output. for eg:- if chair is input it should give chairs as output.

0 Answers   Mind Tree,


program to reverse the order of digits in a given number of any length.

1 Answers   Mind Tree,


how can i split sting in textbox in windows application using c# .net

2 Answers  


How to pass multiple rows from one gridview to another gridview after clicking the checkbox.

1 Answers   Satyam,


Automatically Hyperlink URLs and E-Mail Addresses in ASP.NET Pages with C#

1 Answers  


working with arrays

1 Answers  


Categories
  • ASP.NET Code Interview Questions ASP.NET Code (46)
  • VB.NET Code Interview Questions VB.NET Code (9)
  • C Sharp Code Interview Questions C Sharp Code (51)
  • ADO.NET Code Interview Questions ADO.NET Code (8)