Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Remove Parts of a String
#1
Hello,

I'm quite new to python and am attempting to do some coding on a Raspberry Pi.

I have a sensor that gives an output in the following format.

628.6,339,0.30,1.000


I need to splice it so it just gives me the 628.6

The string isn't always the same length so i need to chop it on the first comma.

I also need to change the decimal point so it looks like this but that should be easy enough once its just a number.

6.286

Thanks
Reply


Messages In This Thread
Remove Parts of a String - by Dean Stackhouse - Sep-29-2016, 01:41 PM
RE: Remove Parts of a String - by j.crater - Sep-29-2016, 02:25 PM
RE: Remove Parts of a String - by wavic - Sep-29-2016, 03:46 PM
RE: Remove Parts of a String - by Dean Stackhouse - Sep-29-2016, 05:18 PM
RE: Remove Parts of a String - by Kebap - Sep-29-2016, 05:54 PM
RE: Remove Parts of a String - by wavic - Sep-29-2016, 10:07 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  remove gilberishs from a "string" kucingkembar 2 300 Mar-15-2024, 08:51 AM
Last Post: kucingkembar
Smile please help me remove error for string.strip() jamie_01 3 1,244 Oct-14-2022, 07:48 AM
Last Post: Pedroski55
  Remove a space between a string and variable in print sie 5 1,841 Jul-27-2022, 02:36 PM
Last Post: deanhystad
  Matching multiple parts in string fozz 31 6,494 Jun-13-2022, 09:38 AM
Last Post: fozz
  How do I remove spurious "." from a string? Zuhan 7 2,101 Apr-12-2022, 02:06 PM
Last Post: Pedroski55
  How to remove char from string?? ridgerunnersjw 2 2,593 Sep-30-2020, 03:49 PM
Last Post: ridgerunnersjw
  Remove from end of string up to and including some character lbtdne 2 2,369 May-17-2020, 09:24 AM
Last Post: menator01
  Remove escape characters / Unicode characters from string DreamingInsanity 5 13,860 May-15-2020, 01:37 PM
Last Post: snippsat
  Highlight and remove specific string of text itsalmade 5 3,594 Dec-11-2019, 11:58 PM
Last Post: micseydel
  Cannot Remove the Double Quotes on a Certain Word (String) Python BeautifulSoup soothsayerpg 5 7,166 Oct-27-2019, 09:53 AM
Last Post: newbieAuggie2019

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020