473,320 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Separating a string on commas

hi
I dont know how to seperate a string containing commas.

suppose i have a string
$text = "this, is, fine";

i want to seperate the above string into
this
is
fine

all the above 3 string shud b in different variables...

Any Help is appreciated!

Thanks

Ravi
Apr 23 '07 #1
3 1690
KevinADC
4,059 Expert 2GB
split function
Apr 23 '07 #2
Hi Dude,

use something like this:

@newval = split(/, /,$string);

the above will split the string with commas and you will get the output in an array.

($val1,$val2,$val3) = split(/, /,$string);


:)
Apr 24 '07 #3
Thank you,

It worked
May 9 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

22
by: ineedyourluvin1 | last post by:
Hello all! I've been looking for a way to strip characters from strings such as a comma. This would be great for using a comma as a delimiter. I show you what I have right now. ...
5
by: Ann Marinas | last post by:
Happy New Year to all! :D I am currently developoing an application that imports data from a CSV file. Each comma represents an array item that I need to extract data with. My problem is...
2
by: Trint Smith | last post by:
Ok, My program has been formating .txt files for input into sql server and ran into a problem...the .txt is an export from an accounting package and is only supposed to contain comas (,) between...
10
by: klineb | last post by:
Good Day, I have written and utility to convert our DOS COBOL data files to a SQL Server database. Part of the process requires parsing each line into a sql statement and validting the data to...
10
by: pantagruel | last post by:
Hi, I'm looking for an optimal javascript function to split a camelcase string and return an array. I suppose one could loop through the string, check if character is uppercase and start...
7
by: OriginalBrownster | last post by:
Hi there: I was wondering if its at all possible to search through a string for a specific character. I want to search through a string backwords and find the last period/comma, then take...
4
by: igotyourdotnet | last post by:
I have a question. I'm reading a CSV file that is uploading to my SQL db, I'm parsing out the file line by line. I'm getting the values and putting them into an arrayList seperate by commas. The...
2
by: weird0 | last post by:
I have to create a string that contains inverted commas inside it. How can i do that in c#? As follows:- "AT+CMGF=1" string temp=""AT+CMGF=1""; // not valid
5
by: Robert Dodier | last post by:
Hello, I'd like to split a string by commas, but only at the "top level" so to speak. An element can be a comma-less substring, or a quoted string, or a substring which looks like a function...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
0
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...

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.