473,473 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

convert 2 byte space to one byte

M D
Is it possible to convert 2 bite space to a single bite space in javascript?

MD
Oct 6 '06 #1
4 1948

M D wrote:
Is it possible to convert 2 bite space to a single bite space in javascript?

MD
Hi

It is not quite clear from your question what you are looking for.

I assume by "bite" you mean "byte"?

If so JavaScript does not support a "byte" type as such.

It has:-

(a) String : which is a sequence of characters, each of which is a
16bit value.

(b) Number : which are IEEE-754 Doubles, with a resolution of 53 bits.

In either case you can use these to store byte values, and there are
bitwise operators in the language, such as & | ^ << >to manipulate
them.

Regards

Julian Turner

Oct 6 '06 #2

M D wrote:
Is it possible to convert 2 bite space to a single bite space in javascript?

MD
Hi

It is not quite clear from your question what you are looking for.

I assume by "bite" you mean "byte"?

If so JavaScript does not support a "byte" type as such.

It has:-

(a) String : which is a sequence of characters, each of which is a
16bit value.

(b) Number : which are IEEE-754 Doubles, with a resolution of 53 bits.

In either case you can use these to store byte values, and there are
bitwise operators in the language, such as & | ^ << >to manipulate
them.

Regards

Julian Turner

Oct 6 '06 #3
JRS: In article <A6oVg.3527$H7.2251@edtnps82>, dated Fri, 6 Oct 2006
08:04:48 remote, seen in news:comp.lang.javascript, M D <md@md.com>
posted :
>Is it possible to convert 2 bite space to a single bite space in javascript?
S = S.replace(/ /, " ") // g before , to do all

See <URL:http://www.merlyn.demon.co.uk/js-valid.htm>

It's a good idea to read the newsgroup and its FAQ. See below.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/>? JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htmjscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/jscr/&c, FAQ items, links.
Oct 6 '06 #4
"M D" <md@md.comwrote in news:A6oVg.3527$H7.2251@edtnps82:
Is it possible to convert 2 bite space to a single bite space in
javascript?
Do you perhaps mean, is it possible to convert two sequential spaces to one
space?
Oct 7 '06 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: David Lawson | last post by:
I know how to conver a string to an array of strings, but I need to convert an ascii string to an array of integers (really unsigned chars). Eg, $str ="ABC"; needs to convert to something...
9
by: mprocopio | last post by:
Fellow JavaScripters, I am looking for code or implementation ideas for converting an integer variable to a four-byte array. I'm porting some of my code from C#, where I make use of their...
13
by: Hako | last post by:
I try this command: >>> import string >>> string.atoi('78',16) 120 this is 120 not 4E. Someone can tell me how to convert a decimal number to hex number? Can print A, B, C,DEF. Thank you.
25
by: Charles Law | last post by:
I thought this was going to be straight forward, given the wealth of conversion functions in .NET, but it is proving more convoluted than imagined. Given the following <code> Dim ba(1) As...
3
by: kaizen | last post by:
Hi, i wrote the code in C and compiled in VC++ compiler. at that time it has thrown the below mentioned error. error C2664: 'strcpy' : cannot convert parameter 2 from 'char' to 'const char *'...
5
by: Bob Homes | last post by:
In VB6, foreground and background colors of controls had to be assigned a single number. If you knew the RGB values for the color, you still had to convert them into the single number accepatable...
4
by: Mason | last post by:
I have tried and tried... I'd like to read in a binary file, convert it's 4 byte values into floats, and then save as a .txt file. This works from the command line (import struct); In : f =...
6
by: Bob Altman | last post by:
Hi all, I'm looking for the fastest way to convert an array of bytes to String. I also need to convert a String back to its original Byte() representation. Convert.ToBase64String and...
12
by: Peter | last post by:
Trying to convert string to byte array. the following code returns byte array of {107, 62, 194, 139, 64} how can I convert this string to a byte array of {107, 62, 139, 65} ...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
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...
0
agi2029
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,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

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.