Skip to content

Commit 4b1724a

Browse files
committed
Merge branch 'master' of https://github.com/Oceania2018/NumSharp
2 parents d9d78e3 + 4d8b5bd commit 4b1724a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/NumSharp.Core/Casting/Implicit/NdArray.Implicit.ValueTypes.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,14 @@ namespace NumSharp.Core
2929
{
3030
public partial class NDArray
3131
{
32+
public static implicit operator string(NDArray nd)
33+
{
34+
if (nd.ndim > 0)
35+
throw new IncorrectShapeException();
36+
37+
return nd.Data<string>(0);
38+
}
39+
3240
public static implicit operator NDArray(float d)
3341
{
3442
var ndArray = new NDArray(typeof(float), new int[0]);

0 commit comments

Comments
 (0)