473,320 Members | 1,810 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.

How to separate values in a string and compare them?

Hi.

I have a string value which is combination of strings separated by a new line character '\n'.
ie test1 + '\n' + test2 + '\n' + ..............

I want to compare each string ie test1 .. test2 ..etc with the some another string..

plese tell me how this can be done using javascript ?.......reply ..
Feb 22 '08 #1
4 1445
hsriat
1,654 Expert 1GB
Hi.

I have a string value which is combination of strings separated by a new line character '\n'.
ie test1 + '\n' + test2 + '\n' + ..............

I want to compare each string ie test1 .. test2 ..etc with the some another string..

plese tell me how this can be done using javascript ?.......reply ..
Expand|Select|Wrap|Line Numbers
  1. var test =  test1 + '\n' + test2 + '\n' + ..............
  2. var testArray = test.split('\n')
Feb 22 '08 #2
Expand|Select|Wrap|Line Numbers
  1. var test =  test1 + '\n' + test2 + '\n' + ..............
  2. var testArray = test.split('\n')
hi...

thanks for ur reply.. but the code is working fine with hardcoded value.. But when i am tring to implement it with variable the '\n' is not getting splitted ..
so it is comparing the two values along with '\n'..
Feb 22 '08 #3
hsriat
1,654 Expert 1GB
hi...

thanks for ur reply.. but the code is working fine with hardcoded value.. But when i am tring to implement it with variable the '\n' is not getting splitted ..
so it is comparing the two values along with '\n'..
post your code, then I can try...
Feb 22 '08 #4
post your code, then I can try...

Hi .. ok I did it using search method ..thanks
Feb 25 '08 #5

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

Similar topics

1
by: gi75research | last post by:
What should be a very simple function is going terribly wrong, and I don't know why. StartTime and EndTime are table values (formatted like "01:00A" or "02:00P"); DaypartStart and DaypartEnd are...
5
by: Jason | last post by:
Is there a mechanism in VB.NET that allows something like: If myVar In ("A","B","C") Then... The way I'm doing it now is: Select Case myVar Case "A","B","C" Or like this:
2
by: darrel | last post by:
I have two comma delimted strings that I need to compare individual values between the two. I assume the solution is likely to put them into an array? If so, do I need to loop through one,...
2
by: Zlatko Matiæ | last post by:
Hello. How to reference selected values from a multi-select list box, as a criteria in a query ? Is it possible at all? Regards, Zlatko
14
by: cody | last post by:
I got a similar idea a couple of months ago, but now this one will require no change to the clr, is relatively easy to implement and would be a great addition to C# 3.0 :) so here we go.. To...
8
by: stephen | last post by:
Hi, I make use of properties to store values that are relevant to the page but this time I am posting the page to itself and the values are Zero or null (they disappear). is there any other way...
3
by: mcolson | last post by:
I am trying to compare the last two values in the same column of a table. First of all, I have a column titled Row_Index that uses an index which starts at 1 and increments by 1. What I am trying...
12
by: =?Utf-8?B?SnVsaWEgQg==?= | last post by:
Hi all I'm creating a hashtable of a list of users in AD. The keys are UserID and Password. I want to loop through the table to compare the userID and password with values that a user has...
9
Thekid
by: Thekid | last post by:
Hi, I can't seem to figure this out. Here's my objective: I have a value that is an md5 hash and I have a wordlist. I need to md5 the words in the list, then compare them to the given hash, then have...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
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...
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...
1
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...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
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
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.