Hi
i need to split a string like so:
eg
select name, goals from goals
table
nani 12,45,2
tevez 23,45,67
rooney 2
Need the output to be like
nani 12
nani 45
nani 2
tevez 23
tevez 45
tevez 67
Any ideas? thanks
View Complete Post
Hi,
I am working on a site where I use the Split function on a string.
To make sure I used a separator character that I do not use anywhere in the data I selected the character 'ã'.
This worked fine in Firefox and Safari, but in IE8 I get an 'Index out of range' error, so apparently the 'ã' character is not handled correctly.
I changed the separator to ';', and then it works fine.
Cheers,
Johnny
I have a string that looks like this: pic1*pic2*pic3*
I want to take out every pic from the string like this:
pic1pic2pic3
I got the first pic but how do i get the other two?
Dim line as string = "pic1*pic2*pic3*" Dim pic1 As String Dim pic2 As String Dim pic3 As String pic1 = line.Substring(0, line.IndexOf("*")) pic2 = ? pic3 = ?
hi, Currently, I have a listbox that the selected items are inserted into the database by a string. Now I need to add a new feature that the searches are suppose to be postback individually so the selected values from the listbox need to be inserted into the database individually so the search can work. Is it possible to split an string into separate variables or into an array? Thanks for your help,Carlos Following is my store procedure and my back code:
Currently, I have a listbox that the selected items are inserted into the database by a string. Now I need to add a new feature that the searches are suppose to be postback individually so the selected values from the listbox need to be inserted into the database individually so the search can work. Is it possible to split an string into separate variables or into an array?
Thanks for your help,
Carlos
Following is my store procedure and my back code:
<script runat="server"> Protected Sub insertcompanydata_click1(ByVal sender As Object, ByVal e As EventArgs) Dim tobresults2 As String Dim li As ListItem Dim myArrayList As ArrayList = New ArrayList() Dim strarr() As String For Each li In txttoblb.Items If li.Selected = True Then myArrayList.Add(li.Text) End If Next strarr = myArrayList.ToArray(Type.GetType("System.String")) tobresults2 = String.Join(", ", strarr) Dim txtloblb1 As String Dim lin As ListItem Dim myArrayList1 As ArrayList = New ArrayList() Dim strarr1() As String
hai everyone,,
I got a situation now... i had a stored proc: How can i get the final select statement in the code behind.
Here is the stored proc.
ALTER PROCEDURE [dbo].[tgms_reclass_PO_bip](@po VARCHAR(20), @old_gl VARCHAR(20), @new_gl VARCHAR(20),@output varchar(500) out ) AS IF (SELECT COUNT(*) FROM mm2po WHERE scode = @po) = 0 BEGIN --SET @output = '1' SET @output = 'Invalid PO Number' END /***************************** Check if Old GL Code is valid ******************************/ IF (@output = '' AND (SELECT COUNT(*) FROM acct WHERE scode = REPLACE(@old_gl,'-','')) = 0) BEGIN --SET @output = '2' SET @output = 'Invalid Old GL Account' END /***************************** Check if New GL Code is valid ******************************/ IF (@output = '' AND (SELECT COUNT(*) FROM acct WHERE scode = REPLACE(@new_gl,'-','')) = 0) BEGIN --SET @output = '3' SET @output = 'Invalid New GL Account' END /**********************
hi all
i want to spilt 115:USD:LKR this string from oracle script. return value should be 115.
pls provide me sql script
thanks
Hi everybody,
How can I split a string from some word.
string test = "Hellow world one two three";
I would lile to get the string part after the word world?? The result will be after splitting the string: "one two three"
I have a table called SubjectRank that provides subject and it's ranking.
I have a string that can be in any format. It can be 'hello cat, how -are you lion?' or 'yes horse'. In short it can be received in any manner and i have no control on how user sends the string.
What I need to do is check if the string contains any words in the subject column. If yes I need to return that word.
In addition if the string contains more than one subject from the table than I must check the ranking and return the value with the highest ranking. (1 lowest) So if the string contains 'hello cat, how -are you lion?' the sp must return the word lion.
How can I achieve this?
Thanks
Rank
Subject
String.Split with with tab as separator I should read the substrings of this file: 1 1 -1738.20118241 6787.03549108 2 2 -1803.20118241 6759.73549108 3 3 -2193.20118241 6759.73549108 I haved used the tab control "\t" as the separator (there is a tab character between the columns): Dim separator() As String = {"\t"} Console.WriteLine("separator(0) = {0}", separator(0)) Try ' Open the file to read from. Using sr As StreamReader = File.OpenText(nomeFile) Do While sr.Peek() >= 0 'Dim line As New StringBuilder Dim stringline As String Dim stringarray As String() Dim x, y, canale Split String on underscore Hi I have a long string and i want to split it on the bases of case change and underscore. here is the following pattern that split on the case change but i also want to split it on the underscore. Can somebody help me out. private static final String DIVIDER_PATTERN = "(?<=[^\\p{Upper}])(?=\\p{Upper})" + "|(?<=[\\p{Lower}])(?=\\d)"; this pattern split "MyFamilyNameIsFar" to "My Family Name Is Far" but i also want to split if there is underscore. like "MyFamily_NameIs_Far" to "My Family Name Is Far" Can somebody tell me which modification i need in this pattern to handle these kind of situation. your help would be appreciated. With Best Regards Split a string matching the following pattern Hi, I would like to match a string that starts with RFF+ folllowed by 2 or 3 characters and followed by colon(:). For instance accepted values are : RFF+AUN: RFF+MO: RFF+NAS: ... Thanks How to Encrypt Query String Parameters in ASP.NET Encrypt Query String Parameters in ASP.NET.u can send secure data one page another page u can also use query string to encrypt Connestion string create any database server This links important to how to create connection string to any data base sever. SQL Connection String We can learn or know how can we connect the database from our .net. This will help for freshers or .NET beginners! Using Conditional Split data Transfer in SSIS 2008 This article uses the Integration Services Conditional Split Data Transformation element to filter and transfer data from a set of flat text files to SQL Server database table. The concept can be easily extended to apply to any other source or destination such as Microsoft Excel. This scenario is useful in creating denormalized database tables in a reporting and analysis situation.
I should read the substrings of this file:
1 1 -1738.20118241 6787.03549108 2 2 -1803.20118241 6759.73549108 3 3 -2193.20118241 6759.73549108
I haved used the tab control "\t" as the separator (there is a tab character between the columns):
Dim separator() As String = {"\t"} Console.WriteLine("separator(0) = {0}", separator(0)) Try ' Open the file to read from. Using sr As StreamReader = File.OpenText(nomeFile) Do While sr.Peek() >= 0 'Dim line As New StringBuilder Dim stringline As String Dim stringarray As String() Dim x, y, canale
I have a long string and i want to split it on the bases of case change and underscore. here is the following pattern that split on the case change but i also want to split it on the underscore. Can somebody help me out.
private static final String DIVIDER_PATTERN = "(?<=[^\\p{Upper}])(?=\\p{Upper})" + "|(?<=[\\p{Lower}])(?=\\d)";
this pattern split "MyFamilyNameIsFar" to "My Family Name Is Far" but i also want to split if there is underscore. like
"MyFamily_NameIs_Far" to "My Family Name Is Far"
Can somebody tell me which modification i need in this pattern to handle these kind of situation.
your help would be appreciated.
With Best Regards
I would like to match a string that starts with RFF+ folllowed by 2 or 3 characters and followed by colon(:).
For instance accepted values are :
RFF+AUN:
RFF+MO:
RFF+NAS:
...
Hall of Fame Twitter Terms of Service Privacy Policy Contact Us Archives Tell A Friend