I have multiline textbox and I am trying to do a search functionality
based on the input entered in this Textbox. I am able to convert into a
string array if the search components are separated by commas, for ex
(Image1, Image2) by using the StringArrayConv erter class available in
..Net 2.0. But I also want to convert the strings entered in new line
for example if I enter
Image1
Image2
I want to convert this into a string array too, I used the split
funtcion but it takes null value between two strings If I don't pass
any delimiter.
Can anybody please help me with this.
Thanks
K 4 36021
Try this...
string[] arr = s.Split(new char[] { '\n' });
where s is your string.
(I think split function takes in a character also, but my compiler is complaining...)
I have multiline textbox and I am trying to do a search functionality
based on the input entered in this Textbox. I am able to convert into
a string array if the search components are separated by commas, for
ex (Image1, Image2) by using the StringArrayConv erter class available
in .Net 2.0. But I also want to convert the strings entered in new
line for example if I enter
Image1
Image2
I want to convert this into a string array too, I used the split
funtcion but it takes null value between two strings If I don't pass
any delimiter.
Can anybody please help me with this.
Thanks
K
Hello kvicky,
I don't think that is the good approach to look substring
I recommend u to read this http://groups.google.com/group/micro...a155249e87e5e0
and see this http://groups.google.com/groups/sear...+search+string
kI have multiline textbox and I am trying to do a search functionality
kbased on the input entered in this Textbox. I am able to convert into
ka string array if the search components are separated by commas, for
kex (Image1, Image2) by using the StringArrayConv erter class available
kin .Net 2.0. But I also want to convert the strings entered in new
kline for example if I enter
k>
kImage1
kImage2
kI want to convert this into a string array too, I used the split
kfuntcion but it takes null value between two strings If I don't pass
kany delimiter.
k>
kCan anybody please help me with this.
k>
kThanks
kK
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
Thanks...that worked and I used trim to remove the carriage return.
K
S Kachru wrote:
Try this...
string[] arr = s.Split(new char[] { '\n' });
where s is your string.
(I think split function takes in a character also, but my compiler is complaining...)
I have multiline textbox and I am trying to do a search functionality
based on the input entered in this Textbox. I am able to convert into
a string array if the search components are separated by commas, for
ex (Image1, Image2) by using the StringArrayConv erter class available
in .Net 2.0. But I also want to convert the strings entered in new
line for example if I enter
Image1
Image2
I want to convert this into a string array too, I used the split
funtcion but it takes null value between two strings If I don't pass
any delimiter.
Can anybody please help me with this.
Thanks
K
Thanks
K
Michael Nemtsev wrote:
Hello kvicky,
I don't think that is the good approach to look substring
I recommend u to read this http://groups.google.com/group/micro...a155249e87e5e0
and see this http://groups.google.com/groups/sear...+search+string
kI have multiline textbox and I am trying to do a search functionality
kbased on the input entered in this Textbox. I am able to convert into
ka string array if the search components are separated by commas, for
kex (Image1, Image2) by using the StringArrayConv erter class available
kin .Net 2.0. But I also want to convert the strings entered in new
kline for example if I enter
k>
kImage1
kImage2
kI want to convert this into a string array too, I used the split
kfuntcion but it takes null value between two strings If I don't pass
kany delimiter.
k>
kCan anybody please help me with this.
k>
kThanks
kK
---
WBR,
Michael Nemtsev :: blog: http://spaces.msn.com/laflour
"At times one remains faithful to a cause only because its opponents do not
cease to be insipid." (c) Friedrich Nietzsche
This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tome73 |
last post by:
How would I convert this string to an Array?
"243, 567, 324, 345"
Where each number becomes a new element in that Array.
Thanks
|
by: Trep |
last post by:
Hi there!
I've been having a lot of difficult trying to figure out a way to convert
a terminated char array to a system::string for use in Visual C++ .NET
2003.
This is necessary because I have some legcay C code that needs to process
a string taken from a textbox, then I need to re-display the string as the
textbox->Text. I easily found how to convert from system::string to char
but I can't figure out how to go the other way!!
|
by: Venkat |
last post by:
Hi All,
Can someone tell me how do we convert a character array to string.
I know the other way.
For eg:-
String strvar = "hello";
printf("%s",strvar.c_str());
regards,
|
by: Brian |
last post by:
I have a string that I received from a web service call and I want to write it to a Stream. I cannot figure out how to access the string as a byte array and write it to the Stream. Any thoughts. I looked at Byte.Parse() but it will only convert a string represntation of a number and convert it to a byte.
Thanks,
Brian
|
by: Ricardo Quintanilla |
last post by:
i have a code that sends data to a socket listening over as400 platform,
the socket responds to me as a "byte array".
then i need to convert the "byte array" into a string.
the problem is that the data converted from the byte array into a string
, is not what i expect.
example:
- the data returned from the socket is (byte array)
"Usuario Sin Atribuciones Para Esta Función"
| |
by: Kueishiong Tu |
last post by:
How do I convert a Byte array (unsigned char managed) to a
char array(unmanaged) with wide character taken into
account?
|
by: Julia |
last post by:
Hi,
I need to convert unicode string to ansi string
Thanks in adavance.
|
by: David |
last post by:
Hi,
how to convert a char array(byte) to a string variable?
byte buffer;
string strTest;
/*the blow codes all get type of 'buffer': System.Byte!
strTest = buffer.ToString()
strTest = System.Convert.ToString(buffer)
|
by: AMP |
last post by:
Hello,
I want to convert a string Array permanantly to a int Array.
Everywhere in my code I have to use Convert.ToInt32 to use the data. I
just want to change it once.
Thanks
Mike
|
by: da1978 |
last post by:
Hi experts,
I need to convert a string or a Byte array to a string byte array.
Its relatively easy to convert a string to an char array or a byte array but not a
STRING byte array. i.e.
Dim Array() As Char
Dim strwork As String = "76A3kj9d6"
Array = strwork.ToCharArray
OR
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
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,...
|
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...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
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,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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...
| |
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |