I am facing an issue with some data that start with a strange character before the number 5
how can I discover all of these characters and remove it
5,AX,AMEX,0,0,0,0,0,0,0,
DM,BSHB,0,0,0,0,0,0,0,MC,
BSHB,1,323.50,0,0,0,0,1,P1,
BSHB,81,7819.25,0,0,0,0,81,
VC,BSHB,5,212.95,0,0,0,0,5
what do you recommend to resolve this issue knowing that I get the data from a specific source so I can not change anything but I am trying to mask it in the view?
regexp_replace can always help to find or replace/remove any characters you want.
For example, if you want to delete all characters escept alphanumeric, space, comma and dot:
regexp_replace(t.str,'[^ ,.[:alnum:]]')
I have a string which contains a mix of normal text and special characters. When setting the label text with this string the character codes are being displayed rather than the actual character. I was wondering is there any support for special characters or if there is a way to decode the values?
I have tried stringWithCString but haven't had any luck with it.
Setting:
self.stringLabel.text = myNSString
Result:
Hello world!
èéêëÄÄÄ
ÿ
ûüùúÅ«
Anyone else come across a similar issue?
I am typing in the arguments for a function, and it is really annoying when IntelliJ removes the space after a comma, when entering a decimal.
Expected:
someFunction(true, .1);
Actual:
someFunction(true,.1);
The instant I press the "." key, the previous space is removed. This doesn't make any sense to me. Help is greatly appreciated!
This could be an issue with your code style for the given language.
Configuring Code Style
Hopefully that pushes you in the right direction.
I am trying to write a VB function to strip unwanted characters from a string. It is for generating a 'clean' url from data that has been inputted into a CMS. Someone has copied and pasted from a Word document and so there appears to be an mdash or ndash in the product title. This results in ─ appearing instead of -
I have tried a Replace(text, Chr(196), Chr(45)) but it isn't working so it can't be 196. Is there a tool or something where I can copy this character and paste it into the tool and it will tell me what char code it is?
Thanks.
You can make your program write out the Character Code using the finction Asc()
Response.write Asc("-") would write out
45
for example.
Try here or here. From 2nd link I can see that your char is alt150
Im doing some screen scraping and im getting back a string that appears to end with whitespace but neither string.strip or strip.gsub(/\s/u, '') removes the character.
Im guessing it's a character encoding issue. Any suggestions?
I think, there are a lot of "space characters".
You can use something like this:
my_string.gsub("\302\240", ' ').strip
You can try this: my_string.gsub(/\A[[:space:]]+|[[:space:]]+\z/, '')
This should remove all space characters from the beginning and the end of string, including all possible unicode space variations.
Figure out the character code of the last character (str[-1].ord) and explicitly search and destroy it. Rinse/repeat if there exist more unwanted characters after that. After doing this, report back here what the invisible character was. (Perhaps it's only invisible because the font you are using does not have that glyph?)