473,614 Members | 2,377 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Data Values

I am using the following to gwt the return value from the serial port
"mabtRxBuf"

I declare my STRdata as a global string and when the code is executed
I get the following for the STRdata

STRdata = "0.10[]" how can i get rid of the [] in my string?
Dim enc As New System.Text.ASC IIEncoding
STRdata = enc.GetString(m abtRxBuf)
Aug 26 '08 #1
6 1073
This will replace all instances of "[]" with "" in your string.

STRdata = Replace(STRdata , "[]", "")

"cmdolcet69 " <co************ @hotmail.comwro te in message
news:84******** *************** ***********@z72 g2000hsb.google groups.com...
I am using the following to gwt the return value from the serial port
"mabtRxBuf"

I declare my STRdata as a global string and when the code is executed
I get the following for the STRdata

STRdata = "0.10[]" how can i get rid of the [] in my string?
Dim enc As New System.Text.ASC IIEncoding
STRdata = enc.GetString(m abtRxBuf)

Aug 26 '08 #2
"cmdolcet69 " <co************ @hotmail.comsch rieb:
>I am using the following to gwt the return value from the serial port
"mabtRxBuf"

I declare my STRdata as a global string and when the code is executed
I get the following for the STRdata

STRdata = "0.10[]" how can i get rid of the [] in my string?
Dim enc As New System.Text.ASC IIEncoding
STRdata = enc.GetString(m abtRxBuf)
Does the string really end with the characters "[]" or is the last character
displayed as a rectangle glyph? If the latter is the case, what's the
character code of the last character? You could use
'String.Left'/'String.Substri ng' to extract a part of the string.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

Aug 26 '08 #3
Maybe you could try this - see if it works:

Dim enc As New System.Text.ASC IIEncoding
STRdata = enc.GetString(m abtRxBuf).Repla ce("[]", "")

As long as this is text data - you should be able to parse out the [].

Rich

*** Sent via Developersdex http://www.developersdex.com ***
Aug 26 '08 #4
On Aug 26, 4:53 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrot e:
"cmdolcet69 " <colin_dolce... @hotmail.comsch rieb:
I am using the following to gwt the return value from the serial port
"mabtRxBuf"
I declare my STRdata as a global string and when the code is executed
I get the following for the STRdata
STRdata = "0.10[]" how can i get rid of the [] in my string?
Dim enc As New System.Text.ASC IIEncoding
STRdata = enc.GetString(m abtRxBuf)

Does the string really end with the characters "[]" or is the last character
displayed as a rectangle glyph? If the latter is the case, what's the
character code of the last character? You could use
'String.Left'/'String.Substri ng' to extract a part of the string.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>
You are correct it is the last character displayed in the "" how can I
get ride of any character [] in my string
Aug 27 '08 #5
On Wed, 27 Aug 2008 05:15:37 -0700 (PDT), cmdolcet69
<co************ @hotmail.comwro te:
>On Aug 26, 4:53 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwro te:
>"cmdolcet69 " <colin_dolce... @hotmail.comsch rieb:
>I am using the following to gwt the return value from the serial port
"mabtRxBuf"
I declare my STRdata as a global string and when the code is executed
I get the following for the STRdata
STRdata = "0.10[]" how can i get rid of the [] in my string?
Dim enc As New System.Text.ASC IIEncoding
STRdata = enc.GetString(m abtRxBuf)

Does the string really end with the characters "[]" or is the last character
displayed as a rectangle glyph? If the latter is the case, what's the
character code of the last character? You could use
'String.Left '/'String.Substri ng' to extract a part of the string.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

You are correct it is the last character displayed in the "" how can I
get ride of any character [] in my string
If str.EndsWith("[]" Then
' Get rid of last two chars if they are []
str = str.Substring(0 , str.Length-2)
End If

or

' Get rid of all occurences of []
str = str.Replace("[]", "")
Aug 27 '08 #6
The box represents a non-ascii character in the string, probably a line feed
or carriage-return. Use StrData.Length to confirm that the string is
actually one character longer than the ASCII characters you can see. If it
is consistently one character longer than it should be then use the
substring method to extract everything except the last character.

STRdata = STRdata.substri ng(0, STRData.length - 1)

Depending on the contents of the string, you might be able to use

STRdata = STRdata.TrimEnd (Nothing)

"cmdolcet69 " <co************ @hotmail.comwro te in message
news:f6******** *************** ***********@y38 g2000hsy.google groups.com...
On Aug 26, 4:53 pm, "Herfried K. Wagner [MVP]" <hirf-spam-me-
h...@gmx.atwrot e:
>"cmdolcet69 " <colin_dolce... @hotmail.comsch rieb:
>I am using the following to gwt the return value from the serial port
"mabtRxBuf"
I declare my STRdata as a global string and when the code is executed
I get the following for the STRdata
STRdata = "0.10[]" how can i get rid of the [] in my string?
Dim enc As New System.Text.ASC IIEncoding
STRdata = enc.GetString(m abtRxBuf)

Does the string really end with the characters "[]" or is the last
character
displayed as a rectangle glyph? If the latter is the case, what's the
character code of the last character? You could use
'String.Left '/'String.Substri ng' to extract a part of the string.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvps.org/>
V B <URL:http://dotnet.mvps.org/dotnet/faqs/>

You are correct it is the last character displayed in the "" how can I
get ride of any character [] in my string
Aug 27 '08 #7

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

Similar topics

2
3929
by: Simon | last post by:
Hi, I am having a little problem with my PHP - MySQl code, I have two tables (shown below) and I am trying populate a template page with data from both. <disclaimer>Now I would like to say my skills, especially with MySQL are rudimentary</disclaimer> However my code (link below) fails, the nested database call does not return any data and this has me stumped. Any help will be much appreciated. Many thanks in advance
5
2030
by: Alexandre | last post by:
Hi, Im a newb to dev and python... my first sefl assigned mission was to read a pickled file containing a list with DB like data and convert this to MySQL... So i wrote my first module which reads this pickled file and writes an XML file with list of tables and fields (... next step will the module who creates the tables according to details found in the XML file). If anyone has some minutes to spare, suggestions and comments would be...
1
1668
by: Diego Buendia | last post by:
I'm facing the next problem: I have a table with two columns (among others) modeling category and subcategory data for each row. I need to summarize info on this two columns, but with the next specs: 1.- Some grouping is only on the category column. 2.- Some other grouping consider the two columns. The values for the two columns come from external source, i.e. I have
7
3909
by: mittal.pradeep | last post by:
What is the better table design for a data collection application. 1. Vertical model (pk, attributeName, AttributeValue) 2. Custom columns (pk, custom1, custom2, custom3...custom50) Since the data elements collected may change year over year, which model better takes of this column dynamicness
7
20987
by: David Bear | last post by:
I have a dictionary that contains a row of data intended for a data base. The dictionary keys are the field names. The values are the values to be inserted. I am looking for a good pythonic way of expressing this, but I have a problem with the way lists are represented when converted to strings. Lets say my dictionary is
7
14801
by: | last post by:
Hello, Does anyone have an idea on how I can filter the data in the gridview control that was returned by an sql query? I have a gridview that works fine when I populate it with data. Now I want to look at that data and filter it based on what is in it. I know that this could have been done with data sets and data views in asp.net 1.1 but how is this done now in asp.net 2.0?
1
1655
by: Michael Bray | last post by:
I have a table that stores data points for several different data sources. The general format is: DECLARE @Data TABLE ( DataID int, TimeCollected int, DataValue decimal(9,9) )
1
2971
by: Matik | last post by:
Hey, First, sorry if this post appear twice, because, I can not find my post recently send, trying to post it once again. I'm out of ideas, so, I thought, will search help here again :( I'm trying to prepare a view for ext. app. This is in normal cases very easy, but what if the view structure should be dynamic?! Here is my point (I will siplify the examples).
8
193989
MMcCarthy
by: MMcCarthy | last post by:
Type MemSize RetVal of VarType() Declaration Char Conversion Boolean 2b vbBoolean(11) CBool() Byte 1b vbByte(17) CByte() Currency 8b vbCurrency(6) @ CCur() Date 8b vbDate(7) CDate() Decimal 14b vbDecimal(14) CDec() Integer 2b vbInteger(2) ...
6
2934
by: insirawali | last post by:
Hi all, I have this problem, i need to know is there a way i cn use the data adapter's update method in this scenario. i have 3 tables as below create table table1{ id1 int identity(1,1) Constraint pk_table1 Primary Key,
0
8620
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, 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...
0
8571
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 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...
1
8265
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,...
0
8423
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 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...
1
6085
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4048
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2560
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 we have to send another system
1
1705
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1420
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.