FInns left-funktionen inbyggd i JavaScript, eller måste man göra den själv. Nån som har koden i så fall? Hämtat ifrån hjälpen i J++ Tror det skall funka ändå...left-funktion i JavaScript
Sv: left-funktion i JavaScript
Mer info kan du hitta antingen i MSDN-hjälpen eller på java.sun.com - leta upp klassen String.
//Emma
public String substring( int beginIndex )
Parameters
beginIndex
the beginning index, inclusive.
Returns
the specified substring.
Description
Returns a new string that is a substring of this string. The substring begins at the specified index and extends to the end of this string.
Exceptions
StringIndexOutOfBoundsException if the beginIndex is out of range.
Syntax 2
public String substring( int beginIndex, int endIndex )
Parameters
beginIndex
the beginning index, inclusive.
endIndex
the ending index, exclusive.
Returns
the specified substring.
Description
Returns a new string that is a substring of this string. The substring begins at the specified beginIndex and extends to the character at index endIndex - 1.
Exceptions
StringIndexOutOfBoundsException if the beginIndex or the endIndex is out of range. Sv: left-funktion i JavaScript
Men felhanteringen ser nog annorlunda ut i Javascript.