Slashes
Oct 14, 2005how do I add slash "" and backslash "/" to a string?
View 2 Replieshow do I add slash "" and backslash "/" to a string?
View 2 RepliesI have a textbox in a form, and I need to allow users to enter dates
in US Format (MM/DD/YYYY). But they do not want to type any slashes,
just 8 numbers, and have the slashes added for them.
I am using IE8 browse. In javascript I am assigning variable filepath.
<%
String filepathXml="C:/abc/work/work.xml";
%>
var filepath= '<%=filepathXml%>';
Here in filpath, it removes all slashes and display as C:abcworkwork.xml
I tired by changing forward slash to backward slash in java variable. But, output is same.
i need to write a function to remove consecutive slashses from a string
[Code]....
I'm trying to make a function to strip a string of all slashes. Initially I had:
Code:
String.prototype.stripSlashes = function ()
{
return this.replace('\','');
}
and that worked fine except it only replaced the first slash (which it apparently is supposed to do). So i read up about global replacements but cant seem to get the right combination of /s and s.
This is what i have at the moment:
[Code]...